#895
Platinum I
KOCKE
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

A robot and five cubes are placed on an infinite board composed of unit squares. The robot and the cubes occupy one square each. The robot can be moved in each of four directions: up, down, left and right. If the square the robot would enter contains a cube, then the robot pushes it in the direction of movement. The cubes possess curious magnetic properties. When two cubes are in neighbouring squares (squares that share a side), they join and become one object. If the robot pushes a cube that is joined with one or more other cubes, all cubes in the group move together. Write a program that controls the robot so that it joins all cubes into a single group which (when viewed from above) forms the letter T in the upright position (it may not be rotated).

입력

The input consists of five lines. Each line contains two integers X and Y (-5 ≤ X, Y ≤ 5), the starting coordinates of one cube. The robot is initially in square (0, 0). No cubes will be located at those coordinates. No pair of cubes will initially be at the same or neighbouring coordinates. More precisely, no cubes will initially share a side (they may share corners).

출력

Output a string of characters representing the robot's moves on a single line. Each character must be one of 'U' (up), 'D' (down), 'L' (left), 'R' (right). The sequence must be at most 9999 characters long.

예제 입력 1

0 1
-1 0
1 0
0 -1
0 -3

예제 출력 1

DRRUUULLDD

예제 입력 2

-2 0
-1 -1
0 -2
1 0
0 1

예제 출력 2

URRDLLURUULDDLLLDR
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Platinum I1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.