mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
19 lines
320 B
C++
19 lines
320 B
C++
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
int main()
|
||
|
{
|
||
|
long long f[21] = {0,2};
|
||
|
int n,i;
|
||
|
for(i = 2;i < 21;i++)
|
||
|
f[i] = 3 * f[i-1] + 2;
|
||
|
while(cin >> n)
|
||
|
{
|
||
|
while(n--)
|
||
|
{
|
||
|
cin >> i;
|
||
|
cout << f[i-1] + 2 << endl;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|