| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 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