#Lutece0593. flip
flip
Migrated from Lutece 593 flip
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Give you a non-negative integer and an operation. The only operation you can do is to reverse one bit in binary form of once(i.e , ).
your goal is to turn into .
Calculate the minimum times of operations you need to do.
Input
The first line of the input is an integer indicates the test cases.
Then follow lines. Each line is a non-negative integer as described above, note that .
Output
Output the minimum times of operations you need to do to reach the goal.
Samples
3
1
2
3
2
1
3
Resources
Sichuan University Programming Contest