Find The Lap Length#11313

Find The Lap Length

1 second
128 megabytes
Medium

This is an interactive problem

You are controlling the robot that is placed on a stadium with a certain lap length. Initially robot is placed at the starting point.

The robot accepts the command "run k", that orders it to move a distance of exactly meters counterclockwise from its current location and report total number of whole laps it passed while performing this and all previous commands (i.e. number of times the robot returned to the starting point after the start of race).

Your task is to determine the lap length using no more than commands.

Interaction

The interaction is started by your program sending the line containing the query "run k" (1 \le k \le 10^9) where is the distance that robot shall pass. Then the jury program prints one integer — total number of the whole laps that are passed after robot ends the movement (the lap is considered passed if the robot is moved through the starting point or stops in it after end of command).

You may assume that the lap length is integer between and 10^9 inclusively.

You may use no more than "run" commands.

If you are ready to print the answer, use the command "ensure s" where is the lap length. After printing the answer the program shall terminate immediately.

For the correct interaction print the end-of-line after each query and the "ensure" command and flush the output buffer with the respective functions of your programming language:

  • cout.flush() or fflush(stdout) for C/C++;

  • stdout.flush() for Python;

  • check your language documentation for the other languages.

Examples

Example 1

Loading
Loading