#include #include using namespace std; int used[205][205]; int a[205][205]; int c; string s; void rec(int x,int y,int i1,int j1){c++; int i=(a[x][y]/1000); int j=a[x][y]%1000; if(x==i-2&&y==j-1){ s+='L';s+='U';} if(x==i-2&&y==j+1){ s+='R';s+='U';} if(x==i&&y==j+2){ s+='R';} if(x==i+2&&y==j+1){ s+='R';s+='L';} if(x==i+2&&y==j-1){ s+='L';s+='L';} if(x==i&&y==j-2){ s+='L';} if(a[x][y]/1000!=i1||a[x][y]%1000!=j1){s+=' '; rec(a[x][y]/1000,a[x][y]%1000,i1,j1);} } void pr(int n, int i1, int j1, int i2, int j2) { std::queue> q; pair x; x.first=i1; x.second=j1; q.push(x); while(!q.empty()){ pair y=q.front();q.pop(); int i=y.first; int j=y.second; if(i<0||i>=n||j<0||j>=n) continue; if(used[y.first][y.second]!=0) continue; used[y.first][y.second]=1; if(i==i2&&j==j2) break; x.first=i-2; x.second=j-1; if(a[x.first][x.second]==0&&x.first>=0&&x.first=0&&x.second=0&&x.first=0&&x.second=0&&x.first=0&&x.second=0&&x.first=0&&x.second=0&&x.first=0&&x.second=0&&x.first=0&&x.second> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; pr(n, i_start, j_start, i_end, j_end); return 0; }