HDU 2046 bone plate shop Square

Source: Internet
Author: User
Problem description in a rectangle square of 2 × N, fill the square with a 1 × 2 bone card, input N, and output the total number of layout solutions.
For example, if n = 3, it is a 2 × 3 square. There are three methods for laying the bone card, for example:


The input data is composed of multiple rows. Each row contains an integer N, indicating that the rectangular square of the test instance is 2 x n (0 <n <= 50 ).


Output for each test instance, please output the total number of the layout scheme, each instance output occupies one line.


Sample Input

132


Sample output

132f (1) = 1; F (2) = 2; F (n) = f (n-1) + f (n-2); Code:
# Include <stdio. h> int main () {_ int64 f [51] = {0, 1, 2}, I; int test; for (I = 3; I <51; I ++) f [I] = f [I-1] + F [I-2]; while (scanf ("% d", & Test )! = EOF) {printf ("% i64d \ n", F [test]);} return 0 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.