atcoder#ABC286F. [ABC286F] Guess The Number 2
[ABC286F] Guess The Number 2
Score : points
Problem Statement
This is an interactive task, where your and the judge's programs interact via Standard Input and Output.
You and the judge will follow the procedure below. The procedure consists of phases and ; phase is immediately followed by phase .
(Phase )
- The judge decides an integer between and (inclusive), which is hidden.
- You print an integer between and (inclusive).
- You also print an integer sequence of length such that for all .
(Phase )
- The judge gives you an integer sequence of length . Here, . is defined by for all integers between and (inclusive), and is the integer resulting from replacing with times.
- Based on the given , you identify the integer that the judge has decided, and print .
After the procedure above, terminate the program immediately to be judged correct.
Constraints
- is an integer between and (inclusive).
Input and Output
This is an interactive task, where your and the judge's programs interact via Standard Input and Output.
(Phase )
- First, print an integer between and (inclusive). It must be followed by a newline.
M
- Then, print a sequence of length consisting of integers between and (inclusive), with spaces in between. It must be followed by a newline.
A_1 A_2 \ldots A_M
(Phase )
- First, an integer sequence of length is given from the input.
B_1 B_2 \ldots B_M
- Find the integer and print it. It must be followed by a newline.
N
If you print something illegal, the judge prints -1
. In that case, your submission is already considered incorrect. Since the judge program terminates at this point, it is desirable that your program terminates too.
Notes
- After each output, add a newline and then flush Standard Output. Otherwise, you may get a TLE verdict.
- If an invalid output is printed during the interaction, or if the program terminates halfway, the verdict will be indeterminate.
- After you print the answer (or you receive
-1
), immediately terminate the program normally. Otherwise, the verdict will be indeterminate. - Note that an excessive newline is also considered an invalid input.
Sample Interaction
The following is a sample interaction with .
Input | Output | Description |
---|---|---|
The judge has decided that . is hidden: it is not given as an input. | ||
4 |
You print . | |
2 3 4 4 |
You print . | |
3 4 4 4 |
, and , so the judge gives to your program. | |
2 |
Based on , you have identified that . Print and terminate the program normally. | |