#include int n,i,j,lin,sc,sm,v[101],a[101][101],sol; int main() { scanf("%d",&n); for(i = 1; i <= n; i++) for(j = 1; j <= n; j++) scanf("%d",&a[i][j]); for(i = 2;i <= n; i++) for(j = 1;j <= n; j++) a[i][j] += a[i-1][j]; sol = -1000001; for(lin = 1;lin <= n; lin++) for(i = lin;i <= n;i++) { for(j = 1; j <= n; j++) v[j] = a[i][j] - a[i-lin][j]; sc = 0; sm =- 1000001; for(j = 1;j <= n;j++) { sc += v[j]; sm = (sc > sm) ? sc : sm; sc = (sc > 0) ? sc : 0; } sol = (sm > sol) ? sm : sol; } printf("%d\n",sol); return 0; }