LATGACH3

View as PDF

Submit solution


Points: 0.21 (partial)
Time limit: 0.9s
Memory limit: 512M
Input: stdin
Output: stdout

Problem source:
ACM
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Đếm số cách lát hình chữ nhật 3*n bằng các domino 2*1.

image

Input

Dữ liệu vào gồm nhiều testcase kết thúc là số ~-1~. Mỗi testcase là một số nguyên ~n~, ~0 \leq~ ~n \leq~ ~30~.

Output

Với mỗi test case, in ra số nguyên là đáp số trên một dòng.

Sample Input

2
8
12
-1

Sample Output

3
153
2131

Comments

Please read the guidelines before commenting.


There are no comments at the moment.