| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 0.1 초 | 1024 MB | 123 | 67 | 52 | 60.465% |
Joe’s bedroom is so dirty that the germs have developed civilization! They have communities and cities everywhere, and the bedroom is their world: Joe’s shoes are giant caves, his fishbowl is an ocean, his moldy pizza boxes are jungles, etc.
One of the biggest germ metropolis, Long City, is built on a long strip of paper left on the floor. It’s an awkward city layout, so the inhabitants decided to go three-dimensional: they will fold the strip several times and turn it into a stack! This way, transportation across the city will be much easier, by moving up and down across layers.
Specifically, the germs will repeat the following procedure $N$ times:
The result will be a stack of 2ドル^N$ paper layers.
Amelia is a powerful and wealthy amoeba who inhabits Long City, and like everyone else, she’s looking forward to the folding. However, she has a particular preference: after the folding process is complete, she would like her home to end up in the $H$-th layer from the ground, because $H$ is her lucky number. To achieve this, Amelia can influence the folding process: at each of the $N$ steps, she can decide whether to fold the left side over the right side, or vice versa.
Now she needs your help to decide the exact sequence of folds to perform. According to Amelia, if you were to divide Long City into 2ドル^N$ sections of equal length, her home would be on the $P$-th section from left to right. Given $N,ドル $P,ドル and $H,ドル find the answer she wants.
The figure below illustrates the first sample. Amelia’s home is on the fourth section of the strip, and after the three shown folds it ends up in the seventh layer from the ground.
The input consists of a single line that contains three integers $N$ (1ドル ≤ N ≤ 60$), $P$ and $H$ (1ドル ≤ P, H ≤ 2^N$), indicating respectively the number of folds, the initial position of Amelia’s home on the strip, and the desired final height in the stack.
Output a single line with a string of length $N$ such that its i-th character indicates how to perform the $i$-th fold. The uppercase letter “L” means folding the left side on top of the right side, while the uppercase letter “R” means folding the right side on top of the left side. It is guaranteed that a unique solution exists.
3 4 7
LRL
4 16 16
LLLR