A student from ITESM Campus Monterrey plays with a new encryption method for numbers. This method consists of the following steps:
| Step | Example |
|---|---|
| 1. Read the number to encrypt | |
| 2. Interpret as a decimal number | (decimal) |
This student failed Computational Organization, that's why this student asked the judges of ITESM Campus Monterrey's internal ACM programming contest to help find the number of 1-bits of these two representations so that he can continue playing.
You have to write a program that reads a number and gives as output the numbers and .
The first line will contain a number which is the number of cases that you have to process. Each of the following lines () will contain the number (, in decimal representation) which is the number the student wants to encrypt.
You will have to output lines, each containing the numbers and in that order, separated by one space, corresponding to that line's number to encrypt.
範例輸入 1
3 265 111 1234
範例輸出 1
3 5 6 3 5 5
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.
| 3. Convert the decimal interpretation of to its binary representation | (binary) |
| 4. Let be equal to the number of 1's in this binary representation |
| 5. Interpret as a hexadecimal number | (hexadecimal) |
| 6. Convert the hexadecimal interpretation of to its binary representation |
| 7. Let be equal to the number of 1's in the last binary representation |
| 8. The encryption is the result of |