#P5396. 第二类斯特林数·列

第二类斯特林数·列

Description

The Stirling number of the second kind {nm}\begin{Bmatrix} n \\m \end{Bmatrix} denotes the number of ways to partition nn distinct elements into mm identical non-empty sets.

Given n,kn, k, for every integer i[0,n]i \in [0, n], you need to compute {ik}\begin{Bmatrix} i \\k \end{Bmatrix}.

Since the answer can be very large, you need to output it modulo 167772161167772161 (225×5+12^{25}\times 5+1, which is a prime).

Input Format

One line with two positive integers n,kn, k, as described above.

Output Format

One line with n+1n+1 non-negative integers.

You need to 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 20%20\% of the testdata, n1000n \leqslant 1000.

For 100%100\% of the testdata, 1k,n<1310721 \leqslant k, n < 131072.

Translated by ChatGPT 5