#include #include #include #include #include #include #include void printShortestPath(int n, int x1, int y1, int x2, int y2) { // Print the distance along with the sequence of moves. char a[n][3]; int count=0; while(!(x1==x2&&y1==y2)){ if(x1>x2){ if(y1>y2){ strcpy(a[count],"UL"); x1=x1-2; y1=y1-1; } else{ strcpy(a[count],"UR"); x1=x1-2; y1=y1+1; } } else if((x1==x2)&&(y1y2){ strcpy(a[count],"LL"); x1=x1+2; y1=y1-1; } else{ strcpy(a[count],"LR"); x1=x1+2; y1=y1+1; } } else{ strcpy(a[count],"L"); y1=y1-2; } count++; } printf("%d\n",count); for(int i=0;i