#include<iostream>
#include<cmath>
using namespace std;
![](http://www.cppblog.com/Images/OutliningIndicators/None.gif)
int dp[33];
![](http://www.cppblog.com/Images/OutliningIndicators/None.gif)
int main()
![](http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif)
{
int text;
cin>>text;
dp[1] = 1;
dp[2] = 2;
dp[3] = 5;
int i;
int sum = 0;
for(i = 4;i <30;i++)
![](http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
sum = (int)pow(2.0,i-1);
dp[i] = sum + dp[i -2]; //规律
}
while(text--)
![](http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
int n;
cin>>n;
cout<<dp[n]<<endl;
}
return 0;
}