#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 cnt = 0; string pro=""; /* //U ((i_start-i_end) >= 2) i_start=i_start-2; //Low ((i_end-i_start) >= 2 ) i_start = i_start+2 //R ((j_end- j_start)>=1) j_start++; //Lef ((j_start-j_end)>=1) j_start--; */ //UL while(((i_start-i_end) >= 2) && ((j_start-j_end)>=1)) { pro.append("UL "); i_start=i_start-2; j_start--; cnt++; } //UR while( ((i_start-i_end) >= 2) && ((j_end- j_start)>=1) ) { cnt++; i_start=i_start-2; j_start++; pro.append("UR "); } //R while ((j_end- j_start)>=1) { j_start = j_start+2; cnt++; pro.append("R "); } //LR while (((i_end-i_start) >= 2 ) &&((j_end- j_start)>=1) ) { i_start = i_start+2; j_start++; cnt++; pro.append("LR "); } //LL while(((i_end-i_start) >= 2 ) && ((j_start-j_end)>=1)) { j_start--; i_start = i_start+2; cnt++; pro.append("LL "); } //L while((j_start-j_end)>=1) { j_start = j_start -2; cnt++; pro.append("L "); } if( (i_end == i_start) &&(j_end == j_start) ) { cout << cnt <> 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; }