Ana and Bernardo pass the time as follows: First, Ana choose a secret number between 1 and . Afterwards, Bernardo conjectures which is that . If he guesses, the game ends. If he is wrong, Ana tells him if is greater or less than the number that Bernardo has conjectured. Bernardo tries again, receiving the answer of Ana, as many times as it is necessary until he guesses.
Your task is to write a program that, for each number given, computes the maximal number of conjectures that Bernardo must do to guess the secret number, supposing that Bernardo plays the possible most cunning way.
The input consists of a sequence of numbers between one and one million.
For each given number, your program must print a line with the maximal number of conjectures that Bernardo must do to guess the secret number.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T11:24:00.672Z
© Jutge.org, 2006–2026.
https://jutge.org