CF2043A.Coin Transformation

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Coin Transformation

Initially, you have a coin with value nn. You can perform the following operation any number of times (possibly zero):

  • transform one coin with value xx, where xx is greater than 33 (x>3x \gt 3), into two coins with value x4\lfloor \frac{x}{4} \rfloor.

What is the maximum number of coins you can have after performing this operation any number of times?

Input

The first line contains one integer tt (1t1041 \le t \le 10^4) — the number of test cases.

Each test case consists of one line containing one integer nn (1n10181 \le n \le 10^{18}).

Output

For each test case, print one integer — the maximum number of coins you can have after performing the operation any number of times.

Note

In the first example, you have a coin of value 11, and you can't do anything with it. So, the answer is 11.

In the second example, you can transform a coin of value 55 into two coins with value 11.

In the third example, you can transform a coin of value 1616 into two coins with value 44. Each of the resulting coins can be transformed into two coins with value 11.

Samples

4
1
5
16
1000000000000000000
1
2
4
536870912

在线编程 IDE

建议全屏模式获得最佳体验