#C4060. Maximum Consecutive Ones in Binary Representation

    ID: 47557 Type: Default 1000ms 256MiB

Maximum Consecutive Ones in Binary Representation

Maximum Consecutive Ones in Binary Representation

You are given a non-negative integer n, and your task is to determine the maximum number of consecutive 1's present in its binary representation.

For example, if n = 13, its binary representation is 1101 and the maximum consecutive 1's is 2.

In mathematical terms, if the binary representation of n is given by \(b_1b_2\ldots b_k\), you need to compute \(\max_{1 \leq i \leq k} \{\text{length of consecutive } 1\text{'s at position } i\}\).

inputFormat

The first line of input contains an integer T (\(1 \leq T \leq 10^5\)), representing the number of test cases. Each of the following T lines contains a single non-negative integer n (\(0 \leq n \leq 10^9\)).

All input is provided via stdin.

outputFormat

For each test case, output one line indicating the maximum number of consecutive 1's in the binary representation of the given integer n. The output for all the test cases should be printed to stdout.

## sample
3
5
13
32
1

2 1

</p>