#include #include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int m1,m2,n1,n2; m1=i_start; m2=i_end; n1=j_start; n2=j_end; int c1=0,a[100]; while((m1!=m2)||(n1!=n2)) { if ((m1<0)||(n1<0)) {c1=0;break;} if ((m1>n)||(n1>n)) {c1=0;break;} if (n1>n2) {if (m1m2) {m1-=2;n1--;a[c1]=2;} else if (m1==m2) {n1-=2;a[c1]=3;}} else {if (m1m2) {m1-=2;n1++;a[c1]=5;} else if (m1==m2) {n1+=2;a[c1]=6;}} c1++; } if (c1==0) cout<<"Impossible"<> 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; }