#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. /*Part 1 - check if possible */ int impos = 0; int totalc = 0; int i_dist = abs(i_start-i_end); if(i_dist%2!=0){ impos = 1; } else{ int j_dist = j_start+(i_dist/2)-j_end; if(!(j_dist%2==0)) impos = 1; } /*Part 2 - If possible, calculate path */ string path=""; if(!impos){ while(i_start!=i_end){ if(i_start>i_end && j_start>j_end){ path+="UL "; i_start-=2; j_start-=1; totalc+=1; } else if(i_start>i_end && j_startj_end){ path+="LL "; i_start+=2; j_start-=1; totalc+=1; } else if(i_start> 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; }