| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 5 초 (추가 시간 없음) | 512 MB | 18 | 0 | 0 | 0.000% |
Vasya studies permutations of length $n$: sequences of $n$ integers such that every integer from 1ドル$ to $n$ occurs in the sequence exactly once. Vasya says a permutation is $k$-interesting if its first $k$ elements are pairwise coprime. By this definition, if a permutation is $i$-interesting, it is also $(i - 1)$-interesting.
Now Vasya wants to find the number of $i$-interesting permutations for all $i$ from 1ドル$ to $n$. If there is no $i$-interesting permutation for a given $i,ドル Vasya won't bother calculating for larger values of $i$. For example, as numbers 2ドル$ and 4ドル$ are not coprime, there is no 5ドル$-interesting permutation of length 5ドル$.
Vasya does not like huge integers, so he calculates the number of permutations modulo a given integer $m$. Help him do it.
The first line contains two integers $n$ and $m$ (1ドル \le n \le 100,ドル 1ドル \le m \le 10^9$).
Print $k$ lines, where $k$ is the maximum number such that there is at least one $k$-interesting permutation of length $n$. On the $i$-th line, print the remainder modulo $m$ of the number of $i$-interesting permutations of length $n$.
5 239
120 108 84 48
4 8
0 4 4