1848: 【CSP函数递归】骨牌铺方格█

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:9 Solved:6

Description

有 lns="http://www.w3.org/1998/Math/MathML">1×nlns="http://www.w3.org/1998/Math/MathML">n≤50)的一个长方形,用 lns="http://www.w3.org/1998/Math/MathML">1×1lns="http://www.w3.org/1998/Math/MathML">1×2 和 lns="http://www.w3.org/1998/Math/MathML">1×3 的骨牌铺满方格,请问有多少种铺法?

例如当 lns="http://www.w3.org/1998/Math/MathML">n=3 时为 lns="http://www.w3.org/1998/Math/MathML">1×3 的方格。此时用 lns="http://www.w3.org/1998/Math/MathML">1×1 、lns="http://www.w3.org/1998/Math/MathML">1×2 和 lns="http://www.w3.org/1998/Math/MathML">1×3 的骨牌铺满方格,共有四种铺法。如下图:


Input

一个整数 lns="http://www.w3.org/1998/Math/MathML">nlns="http://www.w3.org/1998/Math/MathML">n≤50

Output

骨牌的铺法。

Sample Input Copy

3

Sample Output Copy

4