#include using namespace std; typedef unsigned int uint; typedef long long int ll; typedef unsigned long long int ull; #define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout< ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<(t).count()) template ostream& operator <<(ostream &o,const pair p){o<<"("<>height>>width; cin >>sy>>sx>>gy>>gx; // (゚д゚) sx--;sy--;gx--;gy--; gets(maze[0]);//dammy; for (i=0;i> q; q.push(vector{sy,sx}); int x,y,hi; while(!q.empty()){ vector &v = q.front(); x=v[1];y=v[0];hi=maze[y][x]; q.pop(); //printf("%d %d %c\n",x,y,maze[y][x]); maze[y][x]='g'; if (y==gy && x==gx){ cout<<"YES"<{y,x-1}); } if (0{y-1,x}); } if (x{y,x+1}); } if (y{y+1,x}); } if (1{y,x-2}); } if (1{y-2,x}); } if (x{y,x+2}); } if (y{y+2,x}); } } // for (y=0;y