#P5409. 第一类斯特林数·列
第一类斯特林数·列
Description
The Stirling number of the first kind represents the number of ways to arrange distinct elements into circular permutations.
Given , for every integer , you need to compute .
Since the answer can be very large, you need to output the result modulo (, which is a prime).
Input Format
One line with two positive integers , as described in the statement.
Output Format
One line with non-negative integers.
Output, in order, the values of $\begin{bmatrix}0\\ k\end{bmatrix}, \begin{bmatrix}1\\ k\end{bmatrix}, \begin{bmatrix}2\\ k\end{bmatrix}, \dots, \begin{bmatrix}n\\ k\end{bmatrix}$.
3 2
0 0 1 3
Hint
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号