Game with dices
시간 제한2초메모리 제한1024 MB
두 주사위에 0도부터 359도까지 서로 다른 눈금 12개를 붙이고, 매 턴 굴릴 주사위를 골라 원판이 정확히 원점을 덮도록 만든다.
문제
This problem is interactive.
At her loft, Taja found an ancient tabletop game, which she managed to win only from time to time. Show Taja, how to win this game with a guarantee.
Game equipment consists of round piece with a radius of , which has an arrow drawn on top of it, two dices and stickers. Every sticker has unique integer written on it, from to .
Before starting to play one should mark a point on a table, then place round piece on the table, then choose different stickers, and of them stick on the first dice, and another six on the second dice. The goal is to cover the marked point with the piece. It should be achieved by making turns with the following rule. First, player rolls one of the dice and rotates the piece counterclockwise by amount of degrees written on top of the dice. Then the piece moves towards the arrow by the distance of .
Co-ordinates of the marked point is always . Starting position of the center of the piece is and satisfies the following constraint:
Number of queries for this problem equals to the number of made turns.
입력
Input consists of quadruples of lines:
- , --- coordinates of the center of the piece;
- , () --- arrow direction of the piece;
- --- amount of degrees shown on the dice (each side of the dice is shown with the same probability);
- <<
Yes>> --- the piece has covered point, <<No>> --- otherwise.
출력
First two lines of the output should contain integers each, ranging from to --- stickers for first and second dice correspondingly. All integers in these lines should be unique.
Following lines should only contain either or --- number of the dice to roll.