407197: GYM102697 168 Pascal's Triangle

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

Description

168. Pascal's Triangletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
This problem is worth 30 points.

First envisioned by the French mathematician, Blaise Pascal, Pascal's Triangle is a formation of numerals that are arranged in such a way that a number composing a part of the triangle is the summation of the adjacent binomial pair of the previous row in the triangle.

Input

The only line of input contains a single positive integer $$$n$$$.

Output

Output $$$n$$$ lines. The $$$i$$$th line should contain $$$i$$$ space-separated integers, consisting of the $$$i$$$th row of Pascal's Triangle.

ExampleInput
5
Output
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

加入题单

上一题 下一题 算法标签: