#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int i=i_start,j=j_start,z=0,flag=0,a[100]; while((((i!=i_end)||(j!=j_end)))) { if( !((i=0)) || !((j=0)) ) { flag=1; break; } else if((i-i_end>0)&&(j-j_end>=0)) //1 { i=i-2; j=j-1; a[z]=1; z++; } else if((i-i_end>0)&&(j-j_end<=0)) //2 { i=i-2; j=j+1; a[z]=2; z++; } else if((i-i_end==0)&&(j-j_end>0)) //3 { i=i; j=j-2; a[z]=3; z++; } else if((i-i_end==0)&&(j-j_end<0)) //4 { i=i; j=j+2; a[z]=4; z++; } else if((i-i_end<0)&&(j-j_end>=0)) //5 { i=i+2; j=j-1; a[z]=5; z++; } else if((i-i_end<0)&&(j-j_end<=0)) //6 { i=i+2; j=j+1; a[z]=6; z++; } } if(!flag) {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; }