AtCoder Regular Contest 104
D
Multiset Mean
AtCoder
⌀ 2251
原题
← CE →
翻译中…

Problem Statement

翻译中…

Given positive integers $N, K$ and $M$, solve the following problem for every integer $x$ between $1$ and $N$ (inclusive):

翻译中…
  • Find the number, modulo $M$, of non-empty multisets containing between $0$ and $K$ (inclusive) instances of each of the integers $1, 2, 3 \cdots, N$ such that the average of the elements is $x$.
翻译中…

Constraints

翻译中…
  • $1 \leq N, K \leq 100$
  • $10^8 \leq M \leq 10^9 + 9$
  • $M$ is prime.
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N K M

翻译中…

Output

翻译中…

Use the following format:

翻译中…

c_1
c_2
:
c_N

翻译中…

Here, $c_x$ should be the number, modulo $M$, of multisets such that the average of the elements is $x$.

翻译中…

样例

Input #1
3 1 998244353
Output #1
1
3
1
Consider non-empty multisets containing between $0$ and $1$ instance(s) of each of the integers between $1$ and $3$. Among them, there are: - one multiset such that the average of the elements is $k = 1$: $\{1\}$; - three multisets such that the average of the elements is $k = 2$: $\{2\}, \{1, 3\}, \{1, 2, 3\}$; - one multiset such that the average of the elements is $k = 3$: $\{3\}$.
Input #2
1 2 1000000007
Output #2
2
Consider non-empty multisets containing between $0$ and $2$ instances of each of the integers between $1$ and $1$. Among them, there are: - two multisets such that the average of the elements is $k = 1$: $\{1\}, \{1, 1\}$.
Input #3
10 8 861271909
Output #3
8
602
81827
4054238
41331779
41331779
4054238
81827
602
8
题目信息
题号
arc104_d
时间限制
4 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。