#C1829. Pascal's Triangle Generator
Pascal's Triangle Generator
Pascal's Triangle Generator
This problem requires you to generate the first N rows of Pascal's Triangle. Each element in the triangle is computed using the binomial coefficient formula, given in LaTeX as \( C(n, k) = \frac{n!}{k!(n-k)!} \). The triangle should be output with each row on a new line, and each number in a row separated by a space.
Input constraints: 0 \( \leq N \leq 30 \). If N is 0, print nothing.
For example, if N = 5, the output should be:
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
inputFormat
The input is read from standard input. It contains a single integer N on one line, representing the number of rows to generate.
outputFormat
Output the first N rows of Pascal's Triangle. Each row is printed on a new line, and numbers in the same row are separated by a single space. If N is 0, output nothing.
## sample5
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
</p>