#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair P; const int INF=1e8; char s[3010][3010]; int h, w; int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1}; bool check(int i, int j){ int x=(i+j-w+1)/2, y=(i-j+w-1)/2; if(x<0 || x>=h || y<0 || y>=w) return false; return true; } int main() { cin>>h>>w; for(int i=1; i<=h; i++){ scanf("%s", s[i]+1); s[i][0]='.'; s[i][w+1]='.'; } for(int i=0; i que; for(int i=0; id[x][y]+1){ d[x1][y1]=d[x][y]+1; que.push({x1, y1}); } } } int ans=0; for(int i=0; i=h-1 || y<=0 || y>=w-1) continue; ans=max(ans, d[i][j]/2); } } cout<