#t299. 骨牌铺法(domino)

骨牌铺法(domino)

Domino Tiling

Problem Background

Special for beginners, ^_^

Problem Description

There is a 1×n1 \times n rectangle. We want to tile it completely using 1×11 \times 1, 1×21 \times 2, and 1×31 \times 3 dominoes. For example, when n=3n=3 it is a 1×31 \times 3 rectangle. At this time, tiling it with 1×11 \times 1, 1×21 \times 2, and 1×31 \times 3 dominoes gives four tiling methods, as shown in the figure below:

domino tiling.png

Input Format

An integer n (1≤n≤36)n\ (1\le n\le 36), representing the 1×n1\times n rectangle.

Output Format

One integer, the number of ways to tile the given rectangle.

Sample Input 1

3

Sample Output 1

4

Constraints

1s, 1024KiB for each test case.