#include #include #include using namespace std; const int inf=10000000; int L[210][210]; int dr[]={-1, 0, 1, 0}, dc[]={0, -1, 0, 1}; int n, v, ox, oy; int dijkstra(int s, int t) { priority_queue> q; vector d(n*n, inf); d[s]=L[s/n][s%n]; q.emplace(0, s); while (q.size()) { int cost, p; tie(cost, p)=q.top(); q.pop(); cost=-cost; int r=p/n, c=p%n; if (cost>d[p]) continue; for(int i=0;i<4;++i) { int nr=r+dr[i], nc=c+dc[i]; if (nr<0 or nr>=n or nc<0 or nc>=n) continue; int np=nr*n+nc; if (d[np]>cost+L[nr][nc]) { d[np]=cost+L[nr][nc]; q.emplace(-d[np], np); } } } return d[t]; } int main() { while (cin>>n>>v>>ox>>oy) { for(int i=0;i>L[i][j]; if (dijkstra(0, n*n-1)x and (v-x)*2>y ? "YES" : "NO"); } else cout<<"NO"; cout<