#B4166. Longest Consecutive Ones in Binary Representation
Longest Consecutive Ones in Binary Representation
Longest Consecutive Ones in Binary Representation
Given a positive decimal integer \(x\), your task is to output the length of the longest consecutive sequence of \(1\)'s in its binary representation.
You need to solve \(T\) groups of data.
inputFormat
The first line of input contains an integer \(T\) representing the number of test cases. Each of the following \(T\) lines contains a single positive integer \(x\).
outputFormat
For each test case, output a single line containing the maximum number of consecutive \(1\)'s in the binary representation of \(x\).
sample
3
5
13
7
1
2
3
</p>