Mr Wireless

All submissions for this problem are available.
Mr. Wire Less is not that good at implementing circuit in a breadboard. In his Digital Logic Design course, he has to implement several boolean functions using the breadboard. In a breadboard, inputs are given through the switches and outputs are taken through the LEDs. Each input switch can be either in ground state or in high state. So, if he wishes to implement a boolean function, f(x_{1}, x_{2}, .., x_{n}) that takes n boolean values as input and returns m boolean values as output, he will use n switches and m LEDs.
Mr. Wire Less can quickly assemble the necessary ICs and wires, but the key problem is testing. While testing he has to check with all possible input combination, to make sure whether the output of LED corresponds to the expected output or not. This is taking too long for him, as most of the switches are jammed and difficult to toggle.
Mr. Wire Less is asking for help to minimize his time of testing. So, your task is to minimize the total number of switchtoggle throughout the testing.
For example, if Mr. Wire Less has to test a function f(x0, x1) of two variables, he may choose this switchingsequence for testing 00, 11, 10, 01. In this case, the total number of switchtoggle will be 2+1+2 = 5. But if he tests in this sequence 00, 10, 11, 01 total number of toggle will be 1+1+1 = 3.
Given n, you have to output the minimum number of toggle needed for complete testing. Though it seems impractical, he wants you to solve the problem for a very large value of n. But, then the toggle value can be quite big. So, he is completely okay with the toggle value modulo 8589934592 (2^{33}).
Input
The first line of the input contains a positive integer T(T ≤ 10^{5}), denoting the number of testcase. Each of the following T lines contains a single nonnegative integer n(n ≤ 10^{20}).
Output
For every testcase, output a single containing testcase number and the minimum number of switchtoggle modulo 8589934592 (2^{33}).
Sample
Input 2 1 2 Output Case 1: 1 Case 2: 3
Author:  kol_adm 
Editorial  https://discuss.codechef.com/problems/KOL16H 
Tags  acm16kol, binary, easy, kol_adm 
Date Added:  21122016 
Time Limit:  2 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYP3 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 