#include using namespace std; void printShortestPath(int n, int i1, int j1, int i2, int j2) { // Print the distance along with the sequence of moves. if(abs(i2-i1)%2) { cout<<"Impossible"; return; } if(abs(abs(j2-j1)-(abs(i2-i1)/2))%2) { cout<<"Impossible"; return; } vector s; int a=0; while(abs(i2-i1)!=0||abs(j2-j1)!=0) { if(i2>i1) { if(j2>j1) { s.push_back(4); j1+=1; i1+=2; a++; } else if(j2j1) { s.push_back(2); j1+=1; i1-=2; a++; } else if(j2-1) { s.push_back(1); j1-=1; i1-=2; a++; } else { s.push_back(2); j1+=1; i1-=2; a++; } } } else if(i2==i1) { if(j2>j1) { s.push_back(3); j1+=2; a++; } else if(j2> 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; }