#include #include #include #include #include #include #include void printShortestPath(int n, int xi, int ye, int xe, int yi) { // Print the distance along with the sequence of moves. int flag=0; if(yi==ye) { if(xi>xe) { if((xi-xe)%2!=0) { flag=1; } else { int k=(xi-xe)/2,i; printf("%d\n",k); for(i=0;iyi) { if((ye-yi)%2!=0) { flag=1; } else { int k=(ye-yi)/2,i; printf("%d\n",k); for(i=0;ixi&&ye>yi) { if((xe-xi)%2==0) { int k=(xe-xi)/2,i; if((ye-yi-k)%2==0) { printf("%d\n",k+(ye-yi-k)/2); for(i=0;ixi&&yeyi) { if((xi-xe)%2==0) { int k=(xi-xe)/2,i; if((ye-yi-k)%2==0) { printf("%d\n",k+(ye-yi-k)/2); for(i=0;i