시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 (추가 시간 없음) | 1024 MB | 1 | 1 | 1 | 100.000% |
We generate two rooted trees with $n$ vertices in the following way.
The first tree is generated as follows:
The second tree is generated as follows:
A way to generate the trees is good if and only if every vertex $i$ which is a leaf in tree $1$ is not a leaf in tree $2$, and every vertex $i$ which is not a leaf in tree $1$ is a leaf in tree $2$. The root of every tree is not a leaf, regardless of the number of adjacent edges.
Now for all $n \in [2, N]$, calculate the number of good ways to generate trees. Two ways are considered different if and only if there exists a vertex $i$ such that the parent of $i$ in at least one tree is different in these two ways. You should output the answer modulo $M$.
The first line of input contains two integers $N$ and $M$ ($2 \leq N \leq 500$, $10 \leq M \leq 2^{30}$).
Output $N-1$ lines: the answers for $n = 2, 3, \ldots, N$.
5 998244353
1 2 12 120