#abc221g. [abc221_g]Jumping sequence
[abc221_g]Jumping sequence
Problem Statement
Consider an infinite two-dimensional coordinate plane. Takahashi, who is initially standing at , will do jumps in one of the four directions he chooses every time: up, down, left, or right. The length of each jump is fixed. Specifically, the -th jump should cover the distance of . Determine whether it is possible to be exactly at after jumps. If it is possible, show one way to do so.
Here, for each direction, a jump of length from takes him to the following point:
- up:
- down:
- left:
- right: .
Constraints
- $\\lvert A\\rvert, \\lvert B\\rvert \\leq 3.6\\times 10^6$
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
In the first line, print Yes
if there is a desired sequence of jumps, and No
otherwise.
In the case of Yes
, print in the second line a desired sequence of jumps as a string of length consisting of U
, D
, L
, R
, as follows:
- if the -th jump is upward, the -th character should be
U
; - if the -th jump is downward, the -th character should be
D
; - if the -th jump is to the left, the -th character should be
L
; - if the -th jump is to the right, the -th character should be
R
.
Sample Input 1
3 2 -2
1 2 3
Sample Output 1
Yes
LDR
If he jumps left, down, right in this order, Takahashi moves and ends up at , which is desired.
Sample Input 2
2 1 0
1 6
Sample Output 2
No
It is impossible to be exactly at after the two jumps.
Sample Input 3
5 6 7
1 3 5 7 9
Sample Output 3
Yes
LRLUR