AtCoder Beginner Contest 439(Promotion of AtCoderJobs)
G
Sugoroku 6
AtCoder
⌀ 3023
原题
翻译中…

Problem Statement

翻译中…

Happy New Year! When it comes to indoor play on New Year's, it's sugoroku!

翻译中…

There is a sugoroku board consisting of $N+1$ squares: squares $0$, square $1$, $\dots$, square $N$. There is an $M$-sided die (dice) that produces positive integers $A_1, A_2, \dots, A_M$ with equal probability. Here, $A_1, A_2, \dots, A_M$ are distinct. Person $1$, person $2$, $\dots$, person $L$ will play a game using this board. The game proceeds as follows:

翻译中…
  • Initially, place $L$ pieces, piece $1$, piece $2$, $\dots$, piece $L$, on square $0$.
  • Turns come around in numerical order starting with person $1$. Strictly speaking, after person $i$'s turn, the turn goes to person $(i \bmod L) + 1$. Each person performs the following operation on their turn:
  • Let $i$ be the number of the person whose turn it is. Roll the die. Let $x$ be the square where piece $i$ is located and $y$ be the integer that came up on the die, and move piece $i$ to square $\min(N, x+y)$.
  • The first person to place their numbered piece on square $N$ wins, and the other people lose.
翻译中…

For $i =1,2,\dots,L$, find the probability, modulo $998244353$, that person $i$ wins.

翻译中…

What is probability $\text{mod }998244353$? It can be proved that the probability to be found is always a rational number. Also, under the constraints of this problem, when the value is expressed as $\frac{P}{Q}$ using two coprime integers $P$ and $Q$, it can be proved that there exists exactly one integer $R$ that satisfies $R \times Q \equiv P\pmod{998244353}$ and $0 \leq R \lt 998244353$. Find this $R$.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 2.5 \times 10^5$
  • $1 \leq M \leq N$
  • $2 \leq L \leq 2.5 \times 10^5$
  • $1 \leq A_1 \lt A_2 \lt \dots \lt A_M \leq N$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N M L
A_1 A_2 \dots A_M

翻译中…

Output

翻译中…

Output $L$ lines. The $i$-th line should contain the probability that person $i$ wins the game, computed modulo $998244353$.

翻译中…

样例

Input #1
2 2 3
1 2
Output #1
374341633
748683265
873463809
Person $1$ wins with the probability $\frac{5}{8}$, person $2$ wins with the probability $\frac{1}{4}$, and person $3$ wins with the probability $\frac{1}{8}$.
Input #2
100 2 4
20 26
Output #2
164734081
939753473
943409153
946836353
Input #3
123456 12 10
21994 29598 47718 59035 69293 73766 74148 76721 98917 104184 120533 122441
Output #3
580013367
81975961
178650340
610261473
14826260
541995390
307779600
913805572
76177928
687491522
题目信息
题号
abc439_g
时间限制
10 s
内存限制
1024 MB

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