Problem Statement
You are given a tuple of $N$ non-negative integers $A=(A_1,A_2,\ldots,A_N)$ such that $A_1=0$ and $A_N>0$.
Takahashi has $N$ counters. Initially, the values of all counters are $0$.
He will repeat the following operation until, for every $1\leq i\leq N$, the value of the $i$-th counter is at least $A_i$.
Choose one of the
$N$counters uniformly at random and set its value to$0$. (Each choice is independent of others.) Increase the values of the other counters by$1$.
Print the expected value of the number of times Takahashi repeats the operation, modulo $998244353$ (see Notes).
Note
It can be proved that the sought expected value is always finite and rational. Additionally, under the Constraints of this problem, when that value is represented as $\frac{P}{Q}$ using two coprime integers $P$ and $Q$, one can prove that there is a unique integer $R$ such that $R \times Q \equiv P\pmod{998244353}$ and $0 \leq R \lt 998244353$. Find this $R$.
Constraints
$2\leq N\leq 2\times 10^5$$0=A_1\leq A_2\leq \cdots \leq A_N\leq 10^{18}$$A_N>0$- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
N
A_1 A_2 \ldots A_N
Output
Print the expected value of the number of times Takahashi repeats the operation, modulo $998244353$.
样例
2
0 2
6
5
0 1 3 10 1000000000000000000
874839568
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。