#K10306. Pascal's Triangle Row
Pascal's Triangle Row
Pascal's Triangle Row
You are given a non-negative integer n (where n \ge 0
). Your task is to compute the nth row of Pascal's Triangle. Recall that the elements of the nth row are the binomial coefficients, given by the formula: $$\binom{n}{k}$$ for 0 \le k \le n
.
For example, when n is 4, the 4th row of Pascal's Triangle is: 1 4 6 4 1
.
Write a program that reads an integer from standard input and outputs the corresponding row of Pascal's Triangle as space-separated integers.
inputFormat
The input consists of a single line containing a non-negative integer n (0 ≤ n ≤ 30).
outputFormat
Output the nth row of Pascal's Triangle as space-separated integers. For each element, the value corresponds to the binomial coefficient $$\binom{n}{i}$$ for 0 ≤ i ≤ n
.## sample
0
1