| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 36 | 21 | 14 | 50.000% |
Let's call an array $[a_1, a_2, \ldots, a_k]$ of positive integers \textbf {phenomenal}, if the product of its elements is equal to the sum of its elements (i.e. if $a_1 a_2 \ldots a_k = a_1 + a_2 + \ldots + a_k$) .
For example, the array $[2, 2]$ is phenomenal, because $2\cdot 2 = 2+2 = 4$, and $[3, 1, 2]$ is phenomenal, because $3\cdot 1 \cdot 2 = 3 + 1 + 2 = 6$, but the array $[2, 3]$ is not phenomenal, as $2\cdot 3 \neq 2+3$.
Let $f(i)$ denote the number of phenomenal arrays of size $i$. It can be shown that for any fixed $i \ge 2$ there is only a finite number of phenomenal arrays of size $i$.
You are given an integer $n$. Find $f(2), f(3), \ldots, f(n)$. As these numbers can be very big, output them modulo $P$, where $P$ is a given prime number.
The only line of the input contains two integers $n, P$ ($2 \le n \le 2\cdot 10^5$, $10^8 \le P \le 10^9$, $P$ is prime).
Output $n-1$ integers --- the values $f(2), f(3), \ldots, f(n)$ modulo $P$.
7 804437957
1 6 12 40 30 84