#include using namespace std; void printShortestPath(int n, int is, int js, int ie, int je) { // Print the distance along with the sequence of moves. int arpn[n][n]={0}; /*if(is%2==0) {r=0; if(ie%2!=0) cout<<"Impossible"; } if(is%2!=0) {r=1; if(ie%2==0) cout<<"Impossible"; }*/ //lower for(int i=is;i=0;j-=2) { arpn[i][j]=1; } } for(int i=is+2;i=0;j-=2) { arpn[i][j]=1; } } // upper for(int i=is;i>=0;i-=4) {//upper right for(int j=js;j=0;j-=2) { arpn[i][j]=1; } } for(int i=is-2;i>=0;i-=2) { for(int j=js+1;j=0;j-=2) { arpn[i][j]=1; } } if(arpn[ie][je]==0) cout<<"Impossible"; } int main() { int n; cin >> n; int is; int js; int ie; int je; cin >> is >> js >> ie >> je; printShortestPath(n, is, js, ie, je); return 0; }