#include using namespace std; struct cell { int x, y; int dis; cell() {} cell(int x, int y, int dis) : x(x), y(y), dis(dis) {} }; bool isInside(int x, int y, int N) { if (x >= 1 && x <= N && y >= 1 && y <= N) return true; return false; } void printShortestPath(int i_start,int i_end, int j_start,int j_end,int N) { int dx[] = {-2, -2 , 0 , 2 , 2 , 0 }; int dy[] = {-1, 1 , 2 , 1, -1 , -2}; queue q; q.push(cell(i_start, i_end, 0)); cell t; int x, y; bool visit[N + 1][N + 1]; for (int i = 1; i <= N; i++) for (int j = 1; j <= N; j++) visit[i][j] = false; visit[i_start][i_end] = true; while (!q.empty()) { t = q.front(); q.pop(); visit[t.x][t.y] = true; if (t.x == j_start && t.y == j_end) { cout<> N; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(i_start, i_end,j_start,j_end, N); return 0; }