Cars in the Lane

3

5 votes
Basic Programming, Bit Manipulation, Bit manipulation, Easy
Problem

You are given ID of different uni-directional highways in the ByteLand. The highways are quite mysterious. If you convert their IDs to a binary number then it means that the bit position where the value is 0, those lanes are closed or else the lanes are open. Now for each highway, you need to count in how many ways the open lanes of the highway can be occupied.

Note: If none of the lanes are occupied then also it is counted as a way.

Input Format

First line of the input contains an integer T, the number of test cases.
Next T lines contain an integer N.

Output Format

Print T lines, i-th line contains the answer to the i-th test case.

Constraints

1T105
1N1018

Sample Input
4
2
1
4
3
Sample Output
2
2
2
4

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For the first test case N=2, whose binary representation is 10, the first lane is open and the second lane is closed. So either there is no car in any lane or there is a car in the 1st lane. Thus only two combinations are possible.

Editor Image

?