I - Tri Tiling

时间:2023-12-10 14:31:20

Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Submit Status
 #include<cstdio>
using namespace std;
int f(int n)
{
if(n==)
return ;
if(n==)
return ;
else
return *f(n-)-f(n-);
}
int main()
{
int n;
while(scanf("%d",&n)==&&n!=-)
if(n%==)
printf("%d\n",f(n));
else
printf("%d\n",);
return ;
}

Description

In how many ways can you tile a 3xn rectangle with 2x1 dominoes?  Here is a sample tiling of a 3x12 rectangle. I - Tri Tiling

Input

Input consists of several test cases followed by a line containing -1. Each test case is a line containing an integer 0 <= n <= 30.

Output

For each test case, output one integer number giving the number of possible tilings.

Sample Input

2
8
12
-1

Sample Output

3
153
2131 DP!