#include #define NMAX 55 using namespace std; int A[NMAX][NMAX],N,MAX=-99999; void read() { cin>>N; for (int i=1;i<=N;i++) for (int j=1;j<=N;j++) cin>>A[i][j]; } int calc(int x1,int y1,int x2,int y2) { int sum=0; for (int i=x1;i<=x2;i++) sum=sum+A[i][y1]+A[i][y2]; for (int j=y1;j<=y2;j++) sum=sum+A[x1][j]+A[x2][j]; sum=sum-A[x1][y1]-A[x2][y1]-A[x2][y2]-A[x1][y2]; return sum; } void solve() { int i,j,k,l; for (i=1;i<=N;i++) for (j=1;j<=N;j++) for (k=i;k<=N;k++) for (l=j;l<=N;l++) if ((k-i)==(l-j)) if (calc(i,j,k,l)>MAX) MAX=calc(i,j,k,l); cout<