Problem Statement
There are $N$ cards in a box. Each card has an integer written on it, which is between $1$ and $M$, inclusive. For each $i=1,\ldots,M$, there are $C_i$ cards with the number $i$ written on them.
Starting with an empty notebook, you repeat the following operation:
- Randomly draw one card from the box. Write the integer on the card in the notebook, then return the card to the box.
Find the expected value, modulo $998244353$, of the number of times the operation is performed until the notebook has all integers from $1$ to $M$ written at least once.
How to find an expected value modulo $998244353$ The expected value sought in this problem can be proven to always be a rational number. Furthermore, the constraints of this problem guarantee that when the expected value is expressed as an irreducible fraction $\frac yx$, the denominator $x$ is not divisible by $998244353$. Then, there is a unique $0\leq z\lt998244353$ such that $y\equiv xz\pmod{998244353}$. Print this $z$.
Constraints
$1 \leq M \leq N \leq 2\times 10^5$$1 \leq C_i$$\sum_{i=1}^{M}C_i=N$- All input values are integers.
Input
The input is given from Standard Input in the following format:
N M
C_1 \ldots C_M
Output
Print the answer.
样例
2 2
1 1
3
5 2
4 1
748683270
50 50
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
244742906
74070 15
1 2 3 11 22 33 111 222 333 1111 2222 3333 11111 22222 33333
918012973
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。