杭电2077
1 #include<stdio.h> 2 3 long long hlt(long long n) 4 { 5 if(!n) 6 return 0; 7 else 8 return 2+3*hlt(n-1); 9 } 10 11 12 int main() 13 { 14 int n,t; 15 while(~scanf("%d",&n)) 16 while(n--) 17 { 18 scanf("%d",&t); 19 printf("%lld\n",hlt(t-1)+2); 20 } 21 }