Problem H. Problem H. Pow

时间限制 1000 ms   内存限制 512 MB

There are n numbers 3^0, 3^1, . . . , 3^n-1. Each time you can choose a subset of them (may be empty), and then add them up.
Count how many numbers can be represented in this way.
 

输入数据

The first line of the input contains an integer T , denoting the number of test cases. In each test case, there is a single integers n in one line, as described above.
1 ≤ T ≤ 20, 0 ≤ n ≤ 1000
 

输出数据

For each test case, output one line contains a single integer, denoting the answer.
 

样例输入

复制
4
9
7
8
233

样例输出

复制
512
128
256
13803492693581127574869511724554050904902217944340773110325048447598592

提交

请先 登录

© 2025 FAQs Contact About