|
||||||||||
Problem H. PowTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 2258 Accepted Submission(s): 1145 Problem Description 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. Input 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 Output For each test case, output one line contains a single integer, denoting the answer. Sample Input
Sample Output
Source | ||||||||||
|