Score : $600$ points
We have $N$ boxes numbered $1$ to $N$. Initially, Box $i$ contains $A_i$ balls.
You will repeat the following operation $K$ times.
Let $B_i$ be the number of balls in Box $i$ after the $K$ operations, and the score be the product of the numbers of balls, $\prod_{i=1}^{N}B_i$.
Find the expected value of the score modulo $998244353$.
When the expected value in question is represented as an irreducible fraction $p/q$, there uniquely exists an integer $r$ such that $rq\equiv p \pmod{998244353}$ and $0\leq r < 998244353$ under the Constraints of this problem. This $r$ is the value we seek.
Input is given from Standard Input in the following format:
$N$ $K$ $A_1$ $\ldots$ $A_N$
Print the answer.
3 1 1 2 3
665496245
After the operation, the score will be as follows.
Therefore, the expected value in question is $\frac{1}{3}(12+9+8)=\frac{29}{3}$. This value modulo $998244353$ is $665496245$.
2 2 1 2
499122182
After the operations, the score will be as follows.
Therefore, the expected value in question is $\frac{1}{4}(6+6+6+4)=\frac{11}{2}$.
10 1000000000 998244350 998244351 998244352 998244353 998244354 998244355 998244356 998244357 998244358 998244359
138512322