#include using namespace std; vector s; int printpathutil(int n,int x1,int y1,int x2,int y2){ int count=0; if(x1==x2&&y1==y2) { return count; } else if(x1<0||x1>n-1||y1<0||y1>n-1) return INT_MIN; else if(x1y2) { s.push_back("LL"); return (++count)+printpathutil(n,x1+2,y1-1,x2,y2); } } else if(x1>x2) { if(y1>y2) { s.push_back("UL"); return (++count)+printpathutil(n,x1-2,y1-1,x2,y2); } else if(y1<=y2){ s.push_back("UR"); return (++count)+printpathutil(n,x1-2,y1+1,x2,y2); } } else { if(y1y2) { s.push_back("L"); return (++count)+printpathutil(n,x1,y1-2,x2,y2); } } return 0; } void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. int x=printpathutil(n,i_start,j_start,i_end,j_end); if(x<0) cout<<"Impossible"; else { cout<> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }