#include using namespace std; #define N 202 #define pii pair #define pip pair > #define ppp pair< pair , pair > pii NE[6]={{-2,-1},{-2,1},{0,2},{2,1},{2,-1},{0,-2}}; vector > d(N,vector (N,INT_MAX)); pair b[N][N]; int n; string direction(int x,int y){ x=-x; y=-y; if(x==-2 && y==-1) return "UL"; else if(x==-2 && y==1) return "UR"; else if(x==0 && y==2) return "R"; else if(x==2 && y==1) return "LR"; else if(x==2 && y==-1) return "LL"; else return "L"; return "0"; } vector m; bool compare(ppp a,ppp b){ if(a.first.first==b.first.first) return a.first.second > b.first.second; else return a.first.first > b.first.first; } void dist(int x,int y){ int time=0; priority_queue, std::function > h(compare); d[x][y]=0; h.push(make_pair(make_pair(0,time++),make_pair(x,y))); while(!h.empty()){ pii z=h.top().second; int x1=z.first; int y1=z.second; h.pop(); int i; for(i=0;i<6;i++){ int x2=x1+NE[i].first; int y2=y1+NE[i].second; if(x2>=0 && x2=0 && y21+d[x1][y1]){ d[x2][y2]=1+d[x1][y1]; h.push(make_pair(make_pair(d[x2][y2],time++),make_pair(x2,y2))); b[x2][y2]=make_pair(x1,y1); } } } } } void print(int p,int q){ int c=d[p][q]; while(c--){ int i=p,j=q; p=b[i][j].first; q=b[i][j].second; m.push_back(direction(p-i,q-j)); } } int main(){ int i,j,x1,y1,x2,y2; cin>>n>>x1>>y1>>x2>>y2; dist(x1,y1); if(d[x2][y2]!=INT_MAX){ /*for(i=0;i=0;i--) cout<