#include using namespace std; struct node { int x,y; vector>path; bool const operator==(const node& ob) const { return x == ob.x && y == ob.y; } bool operator<(const node& ob) const { return x < ob.x || (x == ob.x && y < ob.y); } }; int n; static int flag=0; int r[]={-2,-2,0,2,2,0}; int c[]={-1,1,2,1,-1,-2}; bool valid(int x,int y) { if(x<0||y<0||x>=n||y>=n) return false; return true; } void printpath(vector>path) { vector>::iterator it; for(it=path.begin();it!=path.end()-1;it++){ if((it+1)->first-(it->first)==-2){ if((it+1)->second-(it->second)==-1) cout<<"UL "; else cout<<"UR "; } else if((it+1)->first-(it->first)==0){ if((it+1)->second-(it->second)==2) cout<<"R "; else cout<<"L "; } else if((it+1)->first-(it->first)==2){ if((it+1)->second-(it->second)==1) cout<<"LR "; else cout<<"LL "; } } } void printShortestPath(node start,node des) { vector>path; path.push_back({start.x,start.y}); queueq; node src={start.x,start.y,path}; q.push(src); mapvisited; visited[src]=true; while(!q.empty()) { node temp=q.front(); q.pop(); int i=temp.x; int j=temp.y; path=temp.path; if(i==des.x&&j==des.y){ int flag=1; cout<> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; node start,des; start.x=i_start; start.y=j_start; des.x=i_end; des.y=j_end; printShortestPath(start,des); return 0; }