#include #include #include #include #include using namespace std; double GetDist(int x,int y,vector> &myV) { int i; double dist=0; for (i=0;i>H>>W; vector> myV; int i,j; for (i=1;i<=H;i++){ string S; cin>>S; for (j=0;jdist){ MaxDist=dist; } } i=H+1; for (j=1;j<=H;j++){ dist=GetDist(i,j,myV); if (MaxDist>dist){ MaxDist=dist; } } j=0; for (i=1;i<=W;i++){ dist=GetDist(i,j,myV); if (MaxDist>dist){ MaxDist=dist; } } j=H+1; for (i=1;i<=W;i++){ dist=GetDist(i,j,myV); if (MaxDist>dist){ MaxDist=dist; } } printf("%.8lf\n",MaxDist); return 0; }