#P10514. 考试

    ID: 11708 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>洛谷原创O2优化概率论洛谷月赛

考试

Background

Life has dreams, and everyone can be wonderful in their own way.

Problem Description

There are nn students taking an exam, and the exam has mm problems.

All students have the same ability, but the difficulty of each problem may be different. For the ii-th problem, there will be a random aia_i students who answer it wrong.

After the exam, kk students are chosen uniformly at random. Find the probability that all of these students answered every problem correctly. Output the answer modulo 998244353998244353.

Input Format

The first line contains three integers n,m,kn, m, k.

The second line contains mm integers, where the ii-th number represents aia_i.

Output Format

Output one integer, the answer modulo 998244353998244353.

5 5 2
1 2 1 2 2
793364682

Hint

Sample Explanation

The probability that all randomly chosen 22 students answer everything correctly is 24325000\frac{243}{25000}. Taking it modulo 998244353998244353, the answer is 793364682793364682.

It can be proven that the answer is always a rational number. If you are not familiar with taking a rational number modulo, you can refer to 【Template】Remainder of a Rational Number.

Constraints

  • For 30%30\% of the testdata, 1n,m101 \le n, m \le 10.
  • For another 10%10\% of the testdata, k=0k = 0.
  • For another 20%20\% of the testdata, 1n10001 \le n \le 1000, 1m1051 \le m \le 10^5.

For all testdata, it is guaranteed that 1n,m1051 \le n, m \le 10^5 and 0k,ain0 \le k, a_i \le n.

Translated by ChatGPT 5