//submitted by HimJ #include #define ll long long #define mod 1000000007 #define pb push_back #define fi first #define se second #define fr(i,s,e) for(i=s;i=n||y>=n||vis[x][y]) return false; return true; } pair > par[200][200]; void printPath(pair > p) { if(!(p.fi==sx&&p.se.fi==sy)) printPath(par[p.fi][p.se.fi]); cout< > > q; q.push({x,{y,0}}); pair > t; vis[x][y] = true; while (!q.empty()) { t = q.front(); q.pop(); vis[t.fi][t.se.fi] = true; if (t.fi == endx && t.se.fi == endy) { cout<> 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; }