#include #define pii pair using namespace std; map dir = { {{-2,-1},"UL"}, {{-2,1}, "UR"}, {{0,2}, "R"}, {{2,1}, "LR"}, {{2,-1}, "LL"}, {{0,-2}, "L"}, }; vector dirV = { {-2,-1},{-2,1},{0,2},{2,1},{2,-1},{0,-2}}; bool check(int cx, int cy, int n){ if(cx < 0 || cy<0){ return false; } if(cx>=n || cy>=n){ return false; } return true; } void print(pii end,map &parent ){ stack s; while(parent[end]!=make_pair(-1,-1)){ //cout< q; set visited; map parent; map moves; q.push({i_start,j_start}); visited.insert({i_start,j_start}); parent[{i_start,j_start}]= {-1,-1}; moves[{i_start,j_start}]=0; while(!q.empty()){ pii curr = q.front(); q.pop(); /*if(curr==make_pair(i_end,j_end)){ cout<first.first<<" "<< it->first.second<<" "<> 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; }