Count the bits
Very Easy
45.0% success
43,924 attempts
1s time
256MB memory
1024KB max code

Given a number N, print the number of set bits in the binary representation of this number.

Input:
The first contains a single integer T denoting the number of test cases. Each test case contains a single integer N

Output:
For each test case, print a single integer denoting the number of set bits in the binary representation of the given N .

Constraints:

  • \( 1 \le T \le 1000 \)
  • \( 1 \le N \le 1000\)
Examples
Input
1
4
Output
1

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 Editor...