#include #define FOR(i, a, b) for (int i = a; i<= b; ++i) #define FORD(i, a, b) for (int i = a; i>=b; --i) #define REP(i, a) for (int i = 0; i #define bit(S, i) (((S) >> i) & 1) #define IO cin.tie(NULL);cout.tie(NULL); #define taskname "" using namespace std; int n, sx, sy, fx, fy; bool fr[N][N]; queue q; bool inside(int i, int j) { return i >= 0 && j >= 0 && i < n && j < n; } const int d[6] = {-2, -2, 0, 2, 2, 0}; const int c[6] = {-1, 1, 2, 1, -1, -2}; const string cm[6] = {"UL", "UR", "R", "LR", "LL", "L"}; int bef[N][N]; void Trace(pp u, int sz) { int i = bef[u.first][u.second]; if (u != pp(sx, sy)) Trace(pp(u.first - d[i],u.second - c[i]), sz + 1); else cout<>n>>sx>>sy>>fx>>fy; BFS(); }