## Baltic OI '20 P1 - Colors

Points: 12 (partial)
Time limit: 0.1s
Memory limit: 256M

Problem type
##### Baltic Olympiad in Informatics: 2020 Day 1, Problem 1

Linda likes to change her hair color from time to time, and would be pleased if her boyfriend Archie would notice the difference between the previous and the new color. Archie always comments on Linda’s hair color if and only if he notices a difference—so Linda always knows whether Archie has spotted the difference or not.

There is a new hair dye series in the market where all available colors are numbered byintegers from to such that a smaller difference of the numerical values also means less visual difference.

Linda assumes that for these series there should be some critical color difference () for which Archie will notice color difference between the current color and the previous color if and will not if .

Now she has bought sets of hair dye from the new series—one for each of the colors from to , and is ready to set up an experiment. Linda will change her hair color on a regular basis and will observe Archie’s reaction—whether he will notice the color change or not. Since for the proper dye each set should be used completely, each hair color can be obtained no more than once.

Before the experiment, Linda was using a dye from a different series which is not compatible with the new one, so for the clearness of the experiment Archie’s reaction to the first used color is meaningless.

Her aim is to find the precise value of in a limited number of dyes. Write a program which finds the value of by experimenting with the given colors and observing Archie’s reactions to color changes.

#### Communication

This is an interactive task. At the beginning the input contains a single integer—the value of (). The value of is kept secret by the grading system. Then your program should make queries writing output in the following format: ? P, where is an integer () denoting the next color used. For each query the grading system gives an answer in the next line of the input. The answer is if Archie notices the color difference between the last two colors and otherwise. No two queries should have the same value.

When your program determines , it should output its value in the following format: = C and stop the execution. The grading system will not respond to this output and will not accept further queries.

#### Notes

It is possible to receive an Output isn’t correct outcome even after printing a correct answer, if task constraints were violated during the communication. Violating the communication protocol itself may result in an Execution killed outcome.

#### Example

7
? 2
1 Answer to the first query is meaningless (can also be 0)
? 7
1
? 4
0
? 1
0
? 5
1 . Therefore, .
= 4

It would be wise to check difference 4. However, this can not be done in the next query since and both are outside the allowed interval .

Your program may use at most queries ? to find the correct value of . Subtasks:

1. ( points)
2. ( points)
3. ( points)
4. ( points)
5. ( points) No further constraints

Note: The official data contains 1256 test cases in total. Grading submissions may take some time.

Note 2: Time limit has been reduced from 0.3s to 0.1s.