Masala #0932
Easy for mathematian
Nargiza sizga bir summani yechish uchun berdi. Siz shuni yeching.
\(S(n)=\displaystyle\sum_{k=1}^{\infty}\lfloor \frac{n+2^{k-1}}{2^{k}}\rfloor\)
\(\lfloor x\rfloor -\) bu \(x\) soning butun qismi.
Birinchi qatorda sizga \(1 \leq t \leq 10^5\) testlar soni kiritiladi.
Keyingi qatordan boshlab \(t\) marotaba \(1\leq n\leq 10^{18}\) natural soni beriladi.
Masala javobini chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
1 2 |
2 |
*Ko'rinishidan qiyin bo'lishi mumkin,lekin oson masala!)