#include using namespace std; void printShortestPath(int n, int i_s, int j_s, int i_e, int j_e) { // Print the distance along with the sequence of moves. if(j_s==j_e) { cout<<"Impossible"; } else { vector v; int flg=0; if(j_e>j_s) { if(i_e>=i_s) { while(i_e>i_s) { v.push_back("LR"); i_s+=2; j_s+=1; } if(i_ej_s) { v.push_back("R"); j_s+=2; } if(j_ei_s) { printf("Impossible"); flg=1; } else { while(j_e>j_s) { v.push_back("R"); j_s+=2; } if(j_e=i_s) { while(i_e>i_s) { v.push_back("LL"); i_s+=2; j_s-=1; } if(i_ej_s) { printf("Impossible"); flg=1; } else { } } } else { while(i_ei_s) { printf("Impossible"); flg=1; } else { while(j_ej_s) { printf("Impossible"); flg=1; } else { } } } } if(flg==0) { printf("%d\n",v.size()); if((v[0]=="lr")&&(v[v.size()-1]=="r")) { for(int i=v.size()-1;i>=0;i--) 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; }