#K67757. Tournament Rounds

    ID: 32713 Type: Default 1000ms 256MiB

Tournament Rounds

Tournament Rounds

You are given an elimination tournament where in each round the players are paired up, and if there is an odd number of players, one player receives a bye. In each round, the number of players is reduced by computing \(\lceil \frac{N}{2} \rceil\). The tournament ends when only one player remains. Your task is to determine the number of rounds required to find the winner given the initial number of players \(N\).

Note: When \(N = 1\), no rounds are played.

Input Format: The input begins with an integer \(T\), denoting the number of test cases. Each of the following \(T\) lines contains a single integer \(N\) representing the number of players.

Output Format: For each test case, output the number of rounds required on a new line.

inputFormat

The first line of input contains an integer \(T\) (\(1 \leq T \leq 10^5\)), the number of test cases. Each of the next \(T\) lines contains an integer \(N\) (\(1 \leq N \leq 10^9\)), the number of players in the tournament.

outputFormat

For each test case, output a single integer on a new line representing the number of rounds required to determine the winner.

## sample
3
1
8
14
0

3 4

</p>