#K94617. Pascal's Triangle Generation
Pascal's Triangle Generation
Pascal's Triangle Generation
Given a non-negative integer N, generate the first N rows of Pascal's Triangle. Recall that the Pascal's Triangle is an array of the binomial coefficients. The element at the n-th row and k-th column is given by the formula: $$C(n,k)=\frac{n!}{k!(n-k)!}$$ for \(0 \le k \le n\). Each row starts and ends with 1, and every inner element is the sum of the two numbers directly above it.
Your task is to read an integer from standard input and output the first N rows of Pascal's Triangle. Each row should be printed on a new line with the numbers separated by a single space.
inputFormat
The input consists of a single integer N ( \(N \ge 0\) ).
It is given via standard input.
outputFormat
Output the first N rows of Pascal's Triangle. For each row, print the numbers separated by a single space. If N is 0 or negative, output nothing.
The output must be printed to standard output.
## sample1
1
</p>