#include using namespace std; typedef unsigned int ui; typedef unsigned long ul; typedef long long ll; typedef unsigned long long ull; typedef vector vi; typedef vector vui; typedef vector vvi; typedef pair ii; typedef vector vii; const int INF = int (1e9) + int (1e5); const ll INFL = ll(2e18) + ll(1e10); const ui M = 1E9 + 7; const double eps = 1e-9; #define MP make_pair #define UNVISITED 0 vii moves; struct graph { int N; vvi dist; vector path; graph(int n) : N(n) {dist.resize(n,vi(n,INF));path.resize(n,vvi (n));} /// DIJKSTRA /// ui dijkstra(int si,int sj, int ti,int tj) { priority_queue > Q; Q.push(vi{0,si,sj}); dist[si][sj] = 0; while(Q.size()) { vi p = Q.top(); Q.pop(); if(p[1] == ti && p[2]== tj) break; for(int idx=0;idx<6;idx++){ int x=p[1]+moves[idx].first; int y=p[2]+moves[idx].second; if (x>=0 && x=0 && ypath[p[1]][p[2]][j]){ for (int jj=j;jj cmoves = {"UL", "UR", "R", "LR", "LL", "L"}; graph g(n); ui l=g.dijkstra(i_start,j_start,i_end,j_end); if (g.dist[i_end][j_end]> 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; }