#K50867. Pascal's Triangle Generation

    ID: 28960 Type: Default 1000ms 256MiB

Pascal's Triangle Generation

Pascal's Triangle Generation

Given a positive integer \(M\), generate the first \(M\) rows of Pascal's Triangle. In Pascal's Triangle, each number is the sum of the two numbers directly above it. If \(M \le 0\), output nothing.

For example, when \(M = 4\), the triangle is:

1
1 1
1 2 1
1 3 3 1

inputFormat

The input consists of a single integer \(M\) provided via standard input, which denotes the number of rows to generate in Pascal's Triangle.

outputFormat

Output the Pascal's Triangle with each row on a new line. Numbers in the same row should be separated by a single space. If \(M \le 0\), output nothing.

## sample
0