#include using namespace std; int a[205][205]; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { queue > q; int i,j; a[j_end][i_end]=1; q.push(pair(j_end,i_end)); int x,y; while(!q.empty()) { x=q.front().first; y=q.front().second; //cout<=0&&a[x-2][y]==0) { a[x-2][y]=a[x][y]+1; q.push(pair(x-2,y)); } if(x+2(x+2,y)); } if(x-1>=0&&y+2(x-1,y+2)); } if(x-1>=0&&y-2>=0&&a[x-1][y-2]==0) { a[x-1][y-2]=a[x][y]+1; q.push(pair(x-1,y-2)); } //cout<<(x+1<=n&&y+2<=n&&a[x+1][y+2]==0)<<'s'; if(x+1(x+1,y+2)); // cout<<(q.back().first)<<' '<=0&&a[x+1][y-2]==0) { a[x+1][y-2]=a[x][y]+1; q.push(pair(x+1,y-2)); } } /*for(i=0;i=0&&y-2>=0&&a[x-1][y-2]==a[x][y]-1) { cout<<"UL"<<' '; x=x-1; y-=2; } else if(y-2>=0&&a[x+1][y-2]==a[x][y]-1) { cout<<"UR"<<' '; x=x+1; y-=2; } else if(a[x+2][y]==a[x][y]-1) { cout<<"R"<<' '; x=x+2; } else if(a[x+1][y+2]==a[x][y]-1) { cout<<"LR"<<' '; x=x+1; y+=2; } else if(x-1>=0&&a[x-1][y+2]==a[x][y]-1) { cout<<"LL"<<' '; x=x-1; y+=2; } else { cout<<"L"<<' '; x=x-2; } } } int main() { int n; cin >> 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; }