#abc243f. F - Lottery

F - Lottery

Score : 500500 points

问题陈述

高桥正在参加一个彩票抽奖活动。

每次抽奖时,他都会获得 NN 个奖品中的一个。第 ii 个奖品被抽中的概率为 Wij=1NWj\frac{W_i}{\sum_{j=1}^{N}W_j}。每次抽奖的结果都是相互独立的。

请问,在进行 KK 次抽奖后,他恰好获得 MM 个不同奖品的概率是多少?请计算结果并以 998244353998244353 取模。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

Takahashi is participating in a lottery.

Each time he takes a draw, he gets one of the NN prizes available. Prize ii is awarded with probability Wij=1NWj\frac{W_i}{\sum_{j=1}^{N}W_j}. The results of the draws are independent of each other.

What is the probability that he gets exactly MM different prizes from KK draws? Find it modulo 998244353998244353.

Note

To print a rational number, start by representing it as a fraction yx\frac{y}{x}. Here, xx and yy should be integers, and xx should not be divisible by 998244353998244353 (under the Constraints of this problem, such a representation is always possible). Then, print the only integer zz between 00 and 998244352998244352 (inclusive) such that xzy(mod998244353)xz\equiv y \pmod{998244353}.

Constraints

  • 1K501 \leq K \leq 50
  • 1MN501 \leq M \leq N \leq 50
  • 0<Wi0 < W_i
  • 0<W1++WN<9982443530 < W_1 + \ldots + W_N < 998244353
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM KK

W1W_1

\vdots

WNW_N

Output

Print the answer.

Sample Input 1

2 1 2
2
1

Sample Output 1

221832079

Each draw awards Prize 11 with probability 23\frac{2}{3} and Prize 22 with probability 13\frac{1}{3}.

He gets Prize 11 at both of the two draws with probability 49\frac{4}{9}, and Prize 22 at both draws with probability 19\frac{1}{9}, so the sought probability is 59\frac{5}{9}.

The modulo 998244353998244353 representation of this value, according to Note, is 221832079221832079.

Sample Input 2

3 3 2
1
1
1

Sample Output 2

0

It is impossible to get three different prizes from two draws, so the sought probability is 00.

Sample Input 3

3 3 10
499122176
499122175
1

Sample Output 3

335346748

Sample Input 4

10 8 15
1
1
1
1
1
1
1
1
1
1

Sample Output 4

755239064

update @ 2024/3/10 10:27:43