{"raw_statement":[{"iden":"statement","content":"NCD students can make new inventions, discover new theories, and face big challenges, but they can't pass the chemistry test.\n\nIn the last test, all the questions were $\\\"T r u e\\\"$ or $\\\"F a l s e\\\"$ questions. After the exam, it turned out that all the answers were correct. \n\nEach student represents his exam paper as a decimal number, where each bit is an answer to a question. For example, if Hasan's paper was $5$, which is ($101_2$) in binary, this means that he answered the $1_{s t}$ and $3_{r d}$ questions as $\\\"T r u e\\\"$, and the rest as $\\\"F a l s e\\\"$, and he got $2$ marks in the exam.\n\nAfter the test, all the students went insane because the test was very hard. So they asked you to give them their marks.\n\nThe first line contains the number of test cases $T$.\n\nFor each test case, the first line contains integer $N$ ($1 <= N <= 10^5$) the number of students.\n\nThe next line contains $N$ space separated integers $A_i$ ($1 <= A_i <= 10^9$) the mark for each student $i$.\n\nFor each test case print $N$ integers the number of correct questions each student has answered.\n\n"},{"iden":"input","content":"The first line contains the number of test cases $T$.For each test case, the first line contains integer $N$ ($1 <= N <= 10^5$) the number of students.The next line contains $N$ space separated integers $A_i$ ($1 <= A_i <= 10^9$) the mark for each student $i$."},{"iden":"output","content":"For each test case print $N$ integers the number of correct questions each student has answered."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ N_k \\in \\mathbb{Z} $ denote the number of students.  \n- Let $ A_k = (a_{k,1}, a_{k,2}, \\dots, a_{k,N_k}) $ be a sequence of integers, where each $ a_{k,i} $ represents the decimal encoding of a student’s answer sheet.\n\n**Constraints**  \n1. $ 1 \\le T \\le 10^4 $ (implied by context)  \n2. For each test case $ k $:  \n   - $ 1 \\le N_k \\le 10^5 $  \n   - $ 1 \\le a_{k,i} \\le 10^9 $ for all $ i \\in \\{1, \\dots, N_k\\} $\n\n**Objective**  \nFor each student $ i $ in test case $ k $, compute the number of 1-bits in the binary representation of $ a_{k,i} $:  \n$$  \n\\text{score}_{k,i} = \\text{popcount}(a_{k,i}) = \\sum_{j=0}^{\\lfloor \\log_2 a_{k,i} \\rfloor} \\left\\lfloor \\frac{a_{k,i}}{2^j} \\right\\rfloor \\bmod 2  \n$$","simple_statement":"For each student, count the number of 1s in the binary representation of their given number.","has_page_source":false}