#include //#define string char[5] using namespace std; char ans[][50]; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int moves=0; while(i_start!=i_end || j_start!=j_end) { int a=(i_start-i_end),b=(j_start-j_end); if(a>0) { i_start-=2; moves++; if(b>0) { //ul j_start-=1; ans[moves-1]="UL"; } else if(b<0) { //ur j_start+=1; ans[moves-1]="UR"; } } else if(a<0) { i_start+=2; moves++; if(b>0) { //ll j_start-=1; ans[moves-1]="LL"; } else if(b<0) { //lr j_start+=1; ans[moves-1]="LR"; } } else { moves++; if(b>0) { //l j_start-=2; ans[moves-1]="L"; } else if(b<0) { //r j_start+=2; ans[moves-1]="R"; } } } if(moves>0) { 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; }