Skip to content

Instantly share code, notes, and snippets.

@sadmiko
Last active June 29, 2018 08:13
Show Gist options
  • Save sadmiko/4e3a867b499b0b0f32c0bf66d9b61ff2 to your computer and use it in GitHub Desktop.
Save sadmiko/4e3a867b499b0b0f32c0bf66d9b61ff2 to your computer and use it in GitHub Desktop.
#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