#include using namespace std; int N; struct Node { int x, y; vector> path; bool const operator==(const Node& ob) const { return x == ob.x && y == ob.y; } bool operator<(const Node& ob) const { return x < ob.x || (x == ob.x && y < ob.y); } }; int col[] = {-1, 1, 2, 1, -1, -2}; int row[] = {-2, -2, 0, 2, 2, 0}; bool isValid(int x, int y) { return (x >= 0 && x < N) && (y >= 0 && y < N); } void printPath(vector> path) { int k=0; for (pair p: path){ if(k != 0){ if(p.first == -1 && p.second == 2){ cout<<"LL " ; } else if(p.first == 1 && p.second == 2 ){ cout<< "LR "; } else if(p.first == 2&& p.second == 0){ cout<< "R "; } else if(p.first == 1 && p.second == -2){ cout<<"UR " ; } else if(p.first == -1 && p.second == -2){ cout<<"UL " ; } else if(p.first == -2 && p.second == 0){ cout<<"L " ; } //cout << "(" << p.first << ", " << p.second << ") "; }k++; } cout << endl; } int findPath(int x, int y, int desa, int desb) { vector> path; path.push_back({x, y}); queue Q; Node src = {x, y, path}; Q.push(src); map visited; visited[src] = true; while (!Q.empty()) { Node curr = Q.front(); Q.pop(); int i = curr.x, j = curr.y; path = curr.path; if (i == desa && j == desb) { if(path.size()-1 != INT_MAX){ cout<>N; int a,b,c,d; cin>>a>>b>>c>>d; int len = findPath( a, b, c, d); if(len == INT_MAX)cout<<"Impossible"; return 0; }