#K76317. Pascal's Triangle Row Generation
Pascal's Triangle Row Generation
Pascal's Triangle Row Generation
Given a non-negative integer n, your task is to generate the nth row of Pascal's Triangle. Recall that the elements of the nth row are given by the binomial coefficients:
$$ C(n,k) = \frac{n!}{k!(n-k)!} $$
for k from 0 to n. The output should be a list of numbers corresponding to these coefficients. For example, when n = 4, the row is [1, 4, 6, 4, 1]
.
Please read the input from standard input and print the output to standard output with numbers separated by a single space.
inputFormat
The input consists of a single integer n (0 ≤ n ≤ 50) provided through standard input.
outputFormat
Output the nth row of Pascal's Triangle as a sequence of integers separated by a single space. There should be no extra spaces at the beginning or end of the line.
## sample0
1