Last active
June 29, 2018 08:13
-
-
Save sadmiko/4e3a867b499b0b0f32c0bf66d9b61ff2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int sx,sy,tx,ty; | |
cin>>sx>>sy>>tx>>ty; | |
int x=tx-sx; | |
int y=ty-sy; | |
for(int i=0;i<x;++i)cout<<"R"; | |
for(int i=0;i<y;++i)cout<<"U"; | |
for(int i=0;i<x;++i)cout<<"L"; | |
for(int i=0;i<y;++i)cout<<"D"; | |
cout<<"D"; | |
for(int i=0;i<x+1;++i)cout<<"R"; | |
for(int i=0;i<y+1;++i)cout<<"U"; | |
cout<<"L"<<"U"; | |
for(int i=0;i<x+1;++i)cout<<"L"; | |
for(int i=0;i<y+1;++i)cout<<"D"; | |
cout<<"R"<<endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment