408976: GYM103401 E Power tower

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Power towertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Consider an array {$$$a_n$$$}, where $$$a_1$$$=2 and $$$a_n$$$=$$$2^{a_{n-1}}$$$, for all n>=2. As you can imagine, while n is huge enough, $$$a_n$$$ looks like a tower, and we call this tower "Power tower".

But as we all know, computer has difficulty in dealing with big integers, so he defines another array $$$b_n$$$=$$$a_n$$$ It is easy to prove that {$$$b_n$$$} is a convergent array.(In other words, $$${\lim_{n \to+ \infty}}b_n$$$ exists). Your task is to calculate the $$${\lim_{n \to+ \infty}}b_n$$$.

Input

The input has manly lines. The first line contains an postive integer T,means the number of limit you need to calculate. The next T lines,Each lines contains an postive integer p. (T<=10^3, p<= 10^7)

Output

The output contains T lines, for each line, you need to output an postive integer p, means the value of $$${\lim_{n \to+ \infty}}b_n$$$.

ExampleInput
3
2
3
6
Output
0
1
4

加入题单

上一题 下一题 算法标签: