All Submissions


A function f(x) is defined as the greatest odd divisor of that number (including itself).

You are given a positive Integer N you have to find f(1)+f(2)+f(3)+.....+f(N).

Input
First Line contains T denoting number of Test cases.
Next T lines Each containing a positive Integer.
Use scanf, printf for fast I/O.

Output
T lines each containing a value as described in the problem statement.

Constraints

T<=100000
Each value of N will be <= 10^9
watchout for overflows.


Sample Input
2
7
1

Sample Output
21
1

Problem Setter : Arjun Singh Bhatia
Problem Tester : Shikhar Sharad


Languages: Brain,C,C++,Java,Pascal,Perl,PHP,Python,Ruby,Text

Time Limit: 1 Second(s)
Score: 0 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0