#P9475. [_-0 A] 考试

    ID: 10556 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>O2优化组合数学二项式定理概率论期望

[_-0 A] 考试

Background

When little g\mathfrak{g} took an exam, she accidentally held the answer sheet upside down.

Problem Description

The answer sheet has n(1n109)n (1 \le n \le 10^9) rows and m(1m109)m (1 \le m \le 10^9) columns, for a total of nmnm questions, arranged from left to right, from top to bottom, row-wise.

Each question has c(4c109)c (4 \le c \le 10^9) options. Among them, the first k(0knm)k (0 \le k \le nm) questions are single-choice questions, with exactly one correct option; the remaining nmknm - k questions are multiple-choice questions, where the number of correct options is strictly greater than 11 and strictly less than cc.

Little g\mathfrak{g} answered all questions correctly, but she accidentally viewed the direction of the answer sheet the wrong way, so her answers were arranged from top to bottom, from left to right, column-wise.

The scoring rule is: you get 11 point if all options are exactly correct; you get 00 points if you select extra options or select any wrong option; if you miss some correct options, you get partial credit proportional to how many you selected.

Formally, let AA be the set of correct options for a question, and let BB be the set of options filled on the answer sheet (both are subsets of {1,2,3,,c}\{1,2,3,\cdots,c\}). Then the score for this question is:

$$\begin{cases}\frac{\lvert B \rvert}{\lvert A \rvert}&\text{if\quad} B\sube A\\0&\text{otherwise}\end{cases}$$

Little g\mathfrak{g} forgot what the correct answers were, so she asked little f\mathfrak{f}. If the exam’s correct answers are chosen uniformly at random among all valid answer keys, what is her expected total score? Since the result may be large, you only need the value modulo 109+710^9+7.

It is guaranteed that neither cc nor 2cc22^c-c-2 is a multiple of 109+710^9+7.

However, little f\mathfrak{f} does not know either, so he asks you for help.

Input Format

One line with four integers n,m,k,cn,m,k,c separated by spaces, representing the number of rows and columns of the answer sheet, the number of single-choice questions, and the number of options for each question.

Output Format

One line with one integer, the expected score modulo 109+710^9+7.

2 3 3 4
760000008
314159265 358979323 84626433832795028 841971693
465094894

Hint

Sample 1 explanation:

The expected score is 6725\frac{67}{25}, and modulo 109+710^9+7 it is 760000008760000008.

One possible correct answer key (in order) is:

C,D,B,AD,ABD,BC\texttt{C,D,B,AD,ABD,BC}

Then the answer sheet should be filled as:

C\texttt{C} D\texttt{D} B\texttt{B}
AD\texttt{AD} ABD\texttt{ABD} BC\texttt{BC}

But it was actually filled as:

C\texttt{C} B\texttt{B} ABD\texttt{ABD}
D\texttt{D} AD\texttt{AD} BC\texttt{BC}

Correct answer C\texttt{C}, filled C\texttt{C}, score 11.

Correct answer D\texttt{D}, filled B\texttt{B}, score 00.

Correct answer B\texttt{B}, filled ABD\texttt{ABD}, score 00.

Correct answer AD\texttt{AD}, filled D\texttt{D}, score 12\frac{1}{2}.

Correct answer ABD\texttt{ABD}, filled AD\texttt{AD}, score 23\frac{2}{3}.

Correct answer BC\texttt{BC}, filled BC\texttt{BC}, score 11.

Therefore, in this case, the exam score is:

1+0+0+12+23+1=1961+0+0+\frac{1}{2}+\frac{2}{3}+1= \frac{19}{6} points.

This problem uses bundled testdata and subtask dependencies.

ID Points n,mn,m\le cc\le Property Dependency
00 N/A Sample None
11 55 10910^9 A
22 22 44 None
33 2020 10310^3 1010 22
44 1515 10910^9 2,32,3
55 10310^3 10310^3
66 10510^5 2,3,52,3,5
77 1010 10910^9 B None
88 None 2,3,5,6,72,3,5,6,7
99 55 10910^9 0,1,2,3,4,5,6,7,80,1,2,3,4,5,6,7,8

Special property A: n=1n=1 or m=1m=1.

Special property B: k=nm2k=nm-2.

Translated by ChatGPT 5