#include #define inf 1e18 using namespace std; struct data { vector path; }; int dx[6] = {-2,-2,0,2,2,0},dy[6] = {-1,1,2,1,-1,-2}; bool valid(int i,int j,int n) { return (i >= 0 && i= 0 && j < n); } void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { data ans[n+1][n+1]; queue > q; q.push({i_start,j_start}); while(!q.empty()) { pair point = q.front(); q.pop(); int x = point.first,y = point.second; for(int i = 0;i < 6;i++) { int cx = x+dx[i] , cy = y+dy[i]; if(valid(cx,cy,n)) { if(ans[cx][cy].path.size() == 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; }