#C662. Pascal's Triangle Row

    ID: 50400 Type: Default 1000ms 256MiB

Pascal's Triangle Row

Pascal's Triangle Row

Given a non-negative integer (n), compute the (n)-th (0-indexed) row of Pascal's Triangle. In Pascal's Triangle, each element is a binomial coefficient and can be computed using the formula (\binom{n}{k} = \frac{n!}{k!(n-k)!}). The row starts at index 0 and each element in the row corresponds to (\binom{n}{k}) for (0 \leq k \leq n).

For example, when (n=4), the output should be: 1 4 6 4 1.

inputFormat

Input consists of a single line containing a non-negative integer (n) (where (0 \leq n \leq 10^5) in practical scenarios).

Note: The input is provided via standard input (stdin).

outputFormat

Output the (n)-th row of Pascal's Triangle as a sequence of space-separated integers on a single line. The output should be sent to standard output (stdout).## sample

0
1