Shall We Play a Game? | 프로그래밍의 벗 PivotOJ
PivotOJ

Shall We Play a Game?

시간 제한: 2000ms메모리 제한: 1024MB출처: MOOI 2016-17 finalBOJ 30762

문제

This is an interactive problem.

1804. Vice-president of the United States of America Aaron Burr challenged gubernatorial race candidate Alexander Hamilton for writing several offending pamphlets.

But Burr is sane enough to understand that, even if he kills Hamilton, he will lose his reputation and ruin his career. So, the enemies decided to simply play a game. To make everything more fair they decided to play it gg times.

Each game starts with Hamilton thinking up a positive integer nn, and after that Burr tries to guess it. For any positive integer xx Burr may ask Hamilton about fraction of numbers between 11 and nn inclusive that are divisible by xx. In the other words, when asks a question about xx, he receives the value of nxn.\frac{\left\lfloor\frac{n}{x}\right\rfloor}{n}. Important detail is that Hamilton reports the answer to Burr as an irreducible fraction (here r\left\lfloor r \right\rfloor denotes the integral part of rr).

Help Burr find the answer using some certain number of queries.

힌트

In the first sample case g=2g = 2. The example queries are listed above, using results of these queries player may understand that in the first game the answer is 1010, and in the second game the answer is 11.

Strictly follow the output format. After printing anything make sure to print a new line and to flush the output buffer, in order to do that you may use flush(output) for Pascal/Delphi, fflush(stdout) or cout.flush() for C/C++, sys.stdout.flush() for Python, System.out.flush() for Java.

예제

예제 1

입력
2

1 2

3 10

1 5

1 5

1 10

1 10

0 1

Correct

1 1

0 1

Correct
출력
X 2

X 3

X 5

X 4

X 6

X 10

X 11

N 10

X 1

X 2

N 1
코드를 제출하려면 로그인하세요.