eolymp
bolt
Try our new interface for solving problems
Problems

Tri Tiling

Tri Tiling

In how many ways can you tile a $3 \times n$ rectangle with $2 \times 1$ dominoes? Here is a sample tiling of a $3 \times 12$ rectangle. \includegraphics{https://static.e-olymp.com/content/eb/eb1f59e1a236e586e215416266f75eef921f6cc0.jpg} \InputFile Consists of several test cases followed by a line containing $-1$. Each test case is a line containing an integer $n~(0 \le n \le 30)$. \OutputFile For each test case print one integer giving the number of possible tilings.
Time limit 1 second
Memory limit 128 MiB
Input example #1
2
8
12
-1
Output example #1
3
153
2131