Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a, b, upper[2]={0, 1}, lower[2]={1, 0}, temp[2]={1, 1};
- void f(bool b)
- {
- if(b)
- {
- cout << 'L';
- lower[0] = temp[0];
- lower[1] = temp[1];
- temp[0]+= upper[0];
- temp[1]+= upper[1];
- }
- else
- {
- cout << 'R';
- upper[0] = temp[0];
- upper[1] = temp[1];
- temp[0]+= lower[0];
- temp[1]+= lower[1];
- }
- }
- int main()
- {
- cin >> a >> b;
- while(temp[0]!=a||temp[1]!=b)
- {
- f(bool(a/b < temp[0]/temp[1]));
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement