Algorithm title: UVA 10862

Source: Internet
Author: User

Asif is a student of East West University and he are currently working for the Ewuisp to meet him relatively high tuition F Ees. One day, as a part's his job, he is instructed to connect cable wires to N houses. All of the houses lie in a straight line. He wants the "minimum number of cable wires required to complete his task such" all the houses receive the Cable service. A house can either get the "connection" from the main transmission center or it can be get it from a house to its immediate lef T or right provided the latter house is already getting the service.

You are are to write a program that determines the number of different combinations of the cable wires this is possible so tha T every house receives the service.

Example: If There are two houses then 3 combinations are possible as shown in the figure.


Figure:circles represent the transmission center and the small rectangles represent the houses.

Input

Each line of input contains a positive integer N (n<=2000). The meaning of N is described in the above paragraph. A value of 0for N indicates the "end of" input which should not to be processed.

Output

For each line of input in have to output, on a single line, the number of possible arrangements. You can safely assume so this number would have less than 1000.

Sample Input

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.