407188: GYM102697 159 Maximum Value in Pascal's Triangle

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

159. Maximum Value in Pascal's Triangletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Pascal's Triangle is a famous concept in mathematics, and it has proven to have incredible relevance in many fields of mathematics even hundreds of years after its creation. The triangle is very simple to construct, starting out with just the number one centered on the first line of a sheet of paper. On the second line, write two ones centered just to the left and right of the one above. For any given line on the triangle, a value is found by adding the value to the upper right and upper left of the specified point, even if the upper right or upper left doesn't exist(meaning the specified point is on the edge of the triangle). Values on the edge of the triangle will always be 1. Your task for this problem is to find the maximum value on a given line of pascal's triangle(with the top line being 0).

Input

A single integer that represents the line of pascal's triangle(with the top line being 0) to have the maximum found for.

Output

A single integer that represents the maximum value on the given line of Pascal's Triangle.

ExampleInput
5
Output
10
Note

If you are struggling with figuring this task out, take a look at binomial coefficients.

加入题单

算法标签: