Sum Modulo

아직 제출이 없습니다시간 제한4초메모리 제한1024 MB

문제

Snuke found a random number generator. It generates an integer between 11 and NN (inclusive). An integer sequence A_1,A_2,,A_NA\_1, A\_2, \cdots, A\_N  represents the probability that each of these integers is generated. The integer ii (1iN1 \leq i \leq N) is generated with probability A_i/SA\_i / S, where S=_i=1NA_iS = \sum\_{i=1}^{N} A\_i. The process of generating an integer is done independently each time the generator is executed.

Snuke has an integer XX, which is now 00. He can perform the following operation any number of times:

  • Generate an integer vv with the generator and replace XX with X+vmodMX + v \mod M.

Find the expected number of operations until XX becomes KK, and print it modulo 998244353998244353. More formally, represent the expected number of operations as an irreducible fraction P/QP/Q. Then, there exists a unique integer RR such that R×QPmod998244353, 0R<998244353R \times Q \equiv P \mod 998244353,\ 0 \leq R < 998244353, so print this RR.

We can prove that the expected number of operations until XX becomes KK is a finite rational number. However, we did not prove its integer representation modulo 998244353998244353 can be defined. Our sincerest apologies. Nonetheless, you don't have to worry about division by 00. More precisely, We can model this problem as an absorbing markov chain, and we guarantee that in all tests, the corresponding fundamental matrices can be defined modulo 998,244,353998\\,244\\,353.

입력

Input is given from Standard Input in the following format:

NN MM KK

A_1A\_1 A_2A\_2 \cdots A_NA\_N

출력

Output the expected number of operations until XX becomes KK, modulo 998,244,353998\\,244\\,353.

제한

  • 1Nmin(500,M1)1 \leq N \leq \min(500,M-1)
  • 2M10182 \leq M \leq 10^{18}
  • 1KM11 \leq K \leq M-1
  • 1A_i1001 \leq A\_i \leq 100
  • All values in input are integers.