NPY and FFT

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 5142
64-bit integer IO format: %I64d      Java class name: Main

Description

A boy named NPY is learning FFT algorithm now.In that algorithm,he needs to do an operation called "reverse".
For example,if the given number is 10.Its binary representaion is 1010.After reversing,the binary number will be 0101.And then we should ignore the leading zero.Then the number we get will be 5,whose binary representaion is 101.
NPY is very interested in this operation.For every given number,he want to know what number he will get after reversing.Can you help him?

Input

The first line contains a integer T — the number of queries ($1 \leq T \leq 100$).
The next T lines,each contains a integer $X(0 \leq X \leq 2^{31}-1$),the given number.

Output

For each query,print the reversed number in a separate line.

Sample Input

3
6
8
1

Sample Output

3
1
1

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .