#include #include #include #include #include #include #include #include #define pb push_back #define lm 510 using namespace std; int a[510][510]; string s; int n,m,res,x,y; int main() { //freopen("cmlsc.in","r",stdin); cin>>n>>m; for(int i=1; i<=n; i++) { cin>>s; for(int j=0; j1) { res=max(res,x+y+a[i][j]); x++; } if(a[i][j]>y+x) { x--; y=a[i][j]; } } else{ if(a[i][j]>1) { x=0; y=a[i][j]; ok=true; } else { ok=false; x=0; } } } } cout<