Bob was bored, so he challenged Alice to a guessing game. Bob starts with an integer
- First he sets
to the midpoint of and , rounding to the integer closest to the value of - Then, he tosses a fair coin, and if it lands tails, he reflects
over
Alice would like you to help her come up with a strategy that minimizes the number of guesses that she has to make. To verify that the strategy that you came up with is reasonable, Alice will check that every guess that you make is between
Constraints
The initial value of
You are allowed to make at most
Interaction
This is an interactive problem, where you and the judge exchange information back-and-forth to solve the problem.
You will start the interaction by proceeding with your guesses. Each guess should be formatted as y
followed by a \n
character. In response, you will be given the current value of
If at any point you attempt an invalid question (such as an invalid output format or a prohibited value of
Please note that you may need to flush stdout
after each operation, or interaction may halt. In C++, this can be done with fflush(stdout)
or cout << flush
(depending on whether you use printf
or cout
). In Java, this can be done with System.out.flush()
. In Python, you can use sys.stdout.flush()
.
Scoring
If you fail to guess
Sample Interaction
>>>
denotes your output. Do not print this out.
>>> 3
2
>>> 4
0
Sample Explanation
The initial value of
Comments