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