#include #include #include #include #include #include using namespace std; void printShortestPath(int i1,int j1,int i2,int j2,int n) { int flag=0,count=0; int x=i1,y=j1; int p; // 0 upwards 1 downwards int q; int temp_p,temp_q,ptr=0; string a[100]; if((i2-i1)%2==0 && ( ((i1-i2)%4==0 && (j1-j2)%2==0 ) ||((i1-i2)%4!=0 && (j1-j2)%2!=0 ) ) ) { stringstream cou; flag=1; while(x!=i2) { temp_p=x-i2; temp_q=y-j2; if(temp_p>0) { if(temp_q>=0) { a[ptr]="UL "; ptr++; y-=1; } else { a[ptr]="UR "; ptr++; y+=1; } x-=2; } else if(temp_p<0) { if(temp_q<=0) { y++; a[ptr]="LR "; ptr++; } else { y--; a[ptr]="LL "; ptr++; } x+=2; } count++; } while(y!=j2) { temp_q=y-j2; if(temp_q>0) { a[ptr]="L "; ptr++; y-=2; } else { a[ptr]="R "; ptr++; y+=2; } count++; } cout<>n; cin>>i1>>j1>>i2>>j2; printShortestPath(i1,j1,i2,j2,n); return 0; }