#include #include #pragma GCC target ("avx") #pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; using namespace atcoder; using ll=long long; #define rep(i,a,b) for(int i=(int)(a);i<=(int)b;i++) #define nrep(i,a,b) for(int i=(int)(a);i>=(int)b;i--) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define moda 998244353LL #define modb 1000000007LL #define gyaku 166374059LL #define dai 2500000000000000000LL #define tyu 2500000000 #define giri 1000000000 #define en 3.14159265358979 #define endl '\n' #define sho -dai #define eps 1e-14 #define yn(x) cout<<(x ? "Yes\n":"No\n"); #define YN(x) cout<<(x ? "YES\n":"NO\n"); #define cou(x) cout<>x; using it=long long; using un=unsigned long long; using db=long double; using st=string; using ch=char; using bo=bool; using P=pair; using ip=pair; using mint=modint; using mints=modint998244353; using minto=modint1000000007; using vi=vector; using ivi=vector; using vd=vector; using vs=vector; using vc=vector; using vb=vector; using vp=vector

; using ivp=vector; using vm=vector; using vms=vector; using vmo=vector; using sp=set

; using isp=set; using ss=set; using sc=set; using si=set; using isi=set; using svi=set; using vvi=vector; using ivvi=vector; using vvd=vector; using vvs=vector; using vvb=vector; using vvc=vector; using vvp=vector; using ivvp=vector; using vvm=vector; using vvms=vector; using vvmo=vector; using vsi=vector; using ivsi=vector; using vsp=vector; using ivsp=vector; using vvsi=vector; using ivvsi=vector; using vvsp=vector; using ivvsp=vector; using vvvi=vector; using ivvvi=vector; using vvvd=vector; using vvvm=vector; using vvvvi=vector; using ivvvvi=vector; template void scan(vector &a){ rep(i,0,a.size()-1)cin>>a[i]; } int haba(ivvi &g,int r,int c,int x,int y,int a,int b){ ivvi dist(r,ivi(c,-1));dist[x][y]=g[x][y]; deque que;que.push_back({x,y}); while(que.size()){ int x=que.front().first,y=que.front().second;que.pop_front(); if(x&&dist[x-1][y]==-1){ dist[x-1][y]=dist[x][y]+g[x-1][y]; if(g[x-1][y])que.push_back({x-1,y}); else que.push_front({x-1,y}); } if(x!=r-1&&dist[x+1][y]==-1){ dist[x+1][y]=dist[x][y]+g[x+1][y]; if(g[x+1][y])que.push_back({x+1,y}); else que.push_front({x+1,y}); } if(y&&dist[x][y-1]==-1){ dist[x][y-1]=dist[x][y]+g[x][y-1]; if(g[x][y-1])que.push_back({x,y-1}); else que.push_front({x,y-1}); } if(y!=c-1&&dist[x][y+1]==-1){ dist[x][y+1]=dist[x][y]+g[x][y+1]; if(g[x][y+1])que.push_back({x,y+1}); else que.push_front({x,y+1}); } } return dist[a][b]; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n,m,k;cin>>n>>m>>k; ivvi a(n,ivi(m)); rep(i,0,n-1) rep(j,0,m-1)cin>>a[i][j]; int ok=1,ng=giri+1; while(ng-ok>1){ int mid=(ng+ok)/2; ivvi g(n,ivi(m)); rep(i,0,n-1) rep(j,0,m-1) g[i][j]=(a[i][j]k)ng=mid; else ok=mid; } cout<