#include "bits/stdc++.h" using namespace std; typedef long long ll; #define rep(i,l,r) for(int i=(l);i<(r);i++) #define fcout cout << fixed << setprecision(10) int h,w; double paint(int a,int b,array,51> p){ double ans=0; rep(i,1,h+1)rep(j,1,w+1)if(p[i][j])ans+=sqrt((a-i)*(a-i)+(b-j)*(b-j)); return ans; } int main(){ cin>>h>>w; array,51> p; string s; rep(i,1,h+1){ cin>>s; rep(j,1,w+1)p[i][j]=s[j-1]-'0'; } double mn=1e20,sum; rep(i,1,h+1){ sum=paint(i,0,p); if(sum