#include #include #include #include #include using namespace std; struct Point{ int x, y; }; struct Node{ Point p; int steps; vector path; }; int main() { int n, sx, sy, fx, fy; cin>>n>>sx>>sy>>fx>>fy; vector< vector > board(n, vector(n, 0)); int yy[] = {-1, 1, 2, 1, -1 -2}; int xx[] = {-2, -2, 0, 2, 2, 0}; queue q; Node start; Point sp = {sx, sy}; int ssteps = 0; vector spath; spath.push_back(sp); start.p = sp; start.steps = ssteps; start.path = spath; board[sx][sy] = 1; q.push(start); int stepCount; vector finalPath; bool found = false; while(!q.empty()){ Node front = q.front(); Point fp = front.p; int fsteps = front.steps; vector fpath = front.path; q.pop(); if(fp.x == fx && fp.y == fy){ //cout<<"XYZ "<