Let Us Understand Computer
Practice
3.4 (167 votes)
Basic programming
Easy
Operator
Operators
Problem
18% Success 49691 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Mr. ABC was recently learning about computer division. Considering the basic model of the computer suppose we wish to divide a number X by D i.e X/D and obtain the result (Note that it is integer division i.e result of 7/2 will be 3).

Now the computer will give the divide overflow error if:

The number of bits in the binary representation(without appending any leading zeroes) of the resulting number(quotient) is greater than the number of bits in the binary representation of divisor(D) (Without appending any leading zeroes).

Now Mr. ABC is given an integer X for T testcases .He wishes to find number of such divisors D(1<=D<=X) for which divide overflow will not occur.

CONSTRAINTS :

\(1 \le T \le 10^6\)

\(1 \le X \le 10^{12}\)

INPUT:

The first line contains the integer T , the number of test cases.

In next lines, each line contains an integer X.

OUTPUT: 

Print the required output for each testcase in new line. 

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
No similar problems found