#include using namespace std; void printShortestPath(int n, int x1, int y1, int x2, int y2) { vector x; // Print the distance along with the sequence of moves. int s=0,f=0; if(abs(x1-x2)%2==1||(abs(x1-x2)==0&&abs(y1-y2)==1)||(abs(x1-x2)==1&&abs(y1-y2)==0)||(abs(x1-x2)==1&&abs(y1-y2)==1)||x1<0||x1>n-1||y1<0||y1>n-1||x2<0||x2>n-1||y2<0||y2>n-1) cout<<"Impossible"; else{ while(!(x1==x2&&y1==y2)){ if((abs(x1-x2)==0&&abs(y1-y2)==1)||(abs(x1-x2)==1&&abs(y1-y2)==0)||(abs(x1-x2)==1&&abs(y1-y2)==1)||x1<0||x1>n-1||y1<0||y1>n-1){ cout<<"Impossible"<y2){ y1-=2; s++; //cout<<"L"<x2){ if(y1>y2){ y1-=1; x1-=2; s++; //cout<<"UL"<y2){ y1-=1; x1+=2; s++; //cout<<"LL"<> 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; }