XY_guiling_ @ 2024-11-18 21:19:50
#include<bits/stdc++.h>
using namespace std;
long long a[1000][1000],n,m,maxx=-123155;
int main(){
cin>>n>>m;
for(long long i=1;i<=n;i++){
for(long long j=1;j<=n;j++)cin>>a[i][j];
}for(long long i=1;i<=n*m/*编号*/;i++){//开始
for(long long j=1;j<=n*m;j++){//结束
//便利
//i%n,i/n;
//j%n,j/n;
long long hei=0,bai=0;
for(long long ii=i%n;ii<=j%n;ii++){
for(long long jj=i/n;jj<=j/n;jj++){
if(a[ii][jj])hei++;
else bai++;
}
}if(hei==bai)maxx=max(maxx,(j%n-i%n)*(j/n-i/n));
}
}cout<<maxx;
}