#include using namespace std; int n, a[60][60], maxs; int i1, j, i2, j2; void citire() { cin>>n; for(int i=1; i<=n; i++) for(int j=1; j<=n; j++) cin>>a[i][j]; } int suma(int i1, int j, int i2, int j2) { int s=0; int i, b; for(i=i1; i<=i2; i++) s=s+a[i][j]; for(b=j+1; b<=j2; b++) s=s+a[i2][b]; for(i=i2-1; i>=i1; i--) s=s+a[i][j2]; for(b=j2-1; b>j; b--) s=s+a[i1][b]; return s; } int main() { int s; int j; citire(); maxs=-32000; for(i1=1; i1<=n; i1++) for(j=1; j<=n; j++) for(i2=i1; i2<=n; i2++) { s=suma(i1, j, i2, i2+j-i1); if(s>maxs) maxs=s; } cout<