#P9475. [_-0 A] 考试
[_-0 A] 考试
Background
When little took an exam, she accidentally held the answer sheet upside down.
Problem Description
The answer sheet has rows and columns, for a total of questions, arranged from left to right, from top to bottom, row-wise.
Each question has options. Among them, the first questions are single-choice questions, with exactly one correct option; the remaining questions are multiple-choice questions, where the number of correct options is strictly greater than and strictly less than .
Little 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 point if all options are exactly correct; you get 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 be the set of correct options for a question, and let be the set of options filled on the answer sheet (both are subsets of ). 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 forgot what the correct answers were, so she asked little . 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 .
It is guaranteed that neither nor is a multiple of .
However, little does not know either, so he asks you for help.
Input Format
One line with four integers 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 .
2 3 3 4
760000008
314159265 358979323 84626433832795028 841971693
465094894
Hint
Sample 1 explanation:
The expected score is , and modulo it is .
One possible correct answer key (in order) is:
Then the answer sheet should be filled as:
But it was actually filled as:
Correct answer , filled , score .
Correct answer , filled , score .
Correct answer , filled , score .
Correct answer , filled , score .
Correct answer , filled , score .
Correct answer , filled , score .
Therefore, in this case, the exam score is:
points.
This problem uses bundled testdata and subtask dependencies.
| ID | Points | Property | Dependency | ||
|---|---|---|---|---|---|
| N/A | Sample | None | |||
| A | |||||
| None | |||||
| B | None | ||||
| None | |||||
Special property A: or .
Special property B: .
Translated by ChatGPT 5