#include using namespace std; #define int long long #define make_pair make_tuple signed main(){ int H,W,X,Y; cin>>H>>W>>X>>Y; X--; Y--; vector> G(H,vector(W)); for(int i=0;i>G[i][j]; vector> U(H,vector(W)); priority_queue> s; U[X][Y] = true; int now = G[X][Y]; int i=X; int j=Y; if(i != 0 && G[i-1][j] < now && !U[i-1][j]){ s.push(make_pair(G[i-1][j],i-1,j)); U[i-1][j] = true; } if(j != 0 && G[i][j-1] < now && !U[i][j-1]){ U[i][j-1] = true; s.push(make_pair(G[i][j-1],i,j-1)); } if(i != H-1 && G[i+1][j] < now && !U[i+1][j]){ s.push(make_pair(G[i+1][j],i+1,j)); U[i+1][j] = true; } if(j != W-1 && G[i][j+1] < now && !U[i][j+1]){ U[i][j+1] = true; s.push(make_pair(G[i][j+1],i,j+1)); } int count = 1; while(!s.empty()){ count++; int a,b,c; tie(a,b,c) = s.top(); /*cout< now){ cout<<"No"<