#include #include #include #define pb push_back #define mp make_pair #define ld long double #define ll long long #define ull unsigned long long using namespace std; #define f cin #define g cout #define Block -1 //ifstream f("gigel.in"); //ofstream g("gigel.out"); int N,M,a[110][110],b[110][110],sol; void Fill(int i,int j) { a[i][j]=max(a[i][j],1); sol=max(sol,a[i][j]); if(j>M>>N; for(int i=1;i<=M;++i) for(int j=1;j<=N;++j) { char c; f>>c; if(c=='&')a[i][j]=Block; } for(int i=1;i<=M;++i) for(int j=1;j<=N;++j) if(a[i][j]!=Block) { Fill(i,j); } //for(int i=1;i<=M;++i,g<<'\n') ///for(int j=1;j<=N;++j)g<