Problems Description
<img src=http://acm.student.cs.uwaterloo.ca/~acm00/050924/domino.jpg> <p>In how many ways can you tile a 3x<em>n</em> rectangle with 2x1 dominoes?</p> <p>Here is a sample tiling of a 3x12 rectangle.</p> <p> </p> <center> <img src="http://acm.student.cs.uwaterloo.ca/%7Eacm00/050924/D.gif" alt="" /> </center> <p>Input consists of several test cases followed by a line containing <i>-1</i>. Each test case is a line containing an integer <em>0 ≤ n ≤ 30</em>. For each test case, output one integer number giving the number of possible tilings.</p>
Input格式
Output格式
Sample
Sample Input 1
2
8
12
-1
Sample Output 1
3
153
2131
Submit Code
请先Login后Submit
🤖 AI 解题助手
OpenRouter
就绪