#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.. char str[80]={}; int count=0; int chars=0; if(abs(i_start-i_end)%2==1) cout<<"Impossible"; else { while(i_end!=i_start || j_end!=j_start) { if(i_start>i_end) //move top { if(j_start>j_end) //move top left { strcat(str,"UL "); i_start-=2; j_start--; count++; } else //move top right { strcat(str,"UR "); i_start-=2; j_start++; count++; } } else //move bottom or right/left { if(i_startj_end) //move top left { strcat(str,"LL "); i_start+=2; j_start--; count++; } else //move top right { strcat(str,"LR "); i_start+=2; j_start++; count++; } } else { if(j_start>j_end) //move left { strcat(str,"L "); j_start-=2; count++; } else //move right { strcat(str,"R "); j_start+=2; count++; } }//move right left } } //end of while 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; }