Leaderboard
Showing:
Mrs. S- JAVA Bits Set 1
Basic Accuracy: 69.63% Submissions: 1328 Points: 1

Mrs. S is very intelligent and very curious to learn new things. She was learning few Bit-algorithms but stuck somewhere and wants your help. The task is to count the set-bits and non set-bits of an integer N. Help her doing the same.

Input:
First line consists of T testcases. Only line of every testcase consists of an integer N.

Output:
For each testcase in new line, print the count of set-bits and non set-bits separated by space.

Constraints:
1 <= T <= 100
1 <= N <=1018

Example:
Input:

2
8
7

Output:
1 3
3 0

Explanation:
Testcase 1:
Binary representation of the given number 8 is: 1 0 0 0. In this representation number of set-bits and non set-bits is 1 and 3.

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Mrs. S- JAVA Bits Set 1

Output Window