Back
Close

How many bits do we need?

Statement
The program:
You must output the number of bits that we need to code a decimal number.
INPUT:
Line 1:An integer t for the number of test.
Following lines:For each line, an integer x which represent a decimal number.

OUTPUT:
For each test on a newline, the number of bits needed to code x.

CONSTRAINTS:
0 < t

EXAMPLE:
Input
2
1
6
Output
1
3
 

Game modes
Fastest

Test cases
Test 1 Test
Input
2 1 6
Output
1 3

Test 2 Test
Input
4 5 2 10 24
Output
3 2 4 5

Test 3 Test
Input
1 256
Output
9

Test 4 Test
Input
3 0 128 56
Output
1 8 6

Solution language

Solution

Stub generator input