#include #include using namespace std; 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 x1,y1,x2,y2; y1=i_start; x1=j_start; y2=i_end; x2=j_end; vector vec; int cond1,cond2,count=0; cond1 = (y1-y2)%2; cond2 = (((y1-y2)/2)+(x1-x2))%2 ; if(cond1 == 1){ //difference b/w y coordinates is odd cout<<"Impossible"; } else if(cond2==1){ cout<<"Impossible"; } else { while(x1!=x2 && y1!=y2){ while(y1>y2 && x1>x2){ vec.push_back("UL"); count++; y1=y1-2; x1=x1-1; } while(y1>y2 && x1x2){ vec.push_back("LL"); count++; y1=y1+2; x1=x1-1; } while(y1==y2 && x1>x2){ vec.push_back("L"); count++; x1=x1-2; } 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; }