#include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<algorithm> #define ll long long #define INF 0x7fffffff #define re register
intmain() { n = read(); while(n) { for(re int i = 1; i <= n; i++) for(re int j = i + 1; j <= n; j++) map[i][j] = map[j][i] = read(); ans = map[1][2]; for(re int i = 3; i <= n; i++) { int Min = INF; for(re int j = 1; j <= i - 1; j++) for(re int k = j + 1; k <= i - 1; k++) Min = min(Min,map[i][j] + map[i][k] - map[j][k]); ans = ans + (Min >> 1); } printf("%d\n",ans); n = read(); } return0; }