#P7158. 「dWoi R1」Password of Shady
「dWoi R1」Password of Shady
Description
This problem asks Shuichi to construct an -digit number that satisfies the following two requirements:
- "The strong never talk nonsense" means the number has no leading zeros. has no leading zeros and is a one-digit number.
- "The strong are good at forming pairs to cooperate" means among all digits of this number, there are an even number of digit . is an even number.
Shuichi quickly had Iruma make a number generator, but the generator still needs the count of numbers that satisfy the requirements. So he asked you for help. Since making the generator already took 59.5 s, he wants you to compute how many numbers satisfy the requirements in 0.5 s.
Output the answer modulo .
Input Format
This problem has multiple test cases, with test cases.
For each test case, one line contains two integers .
Output Format
For each test case, output one integer per line representing the answer.
2
2 3
11 4
73
842367440
Hint
Explanation for Sample 1
For the first test case, the numbers that satisfy the requirements are:
- occurrences of digit : , , , , , , , , , .
- occurrences of digit : .
The sample explanation for the second test case had 114514 lines, but 0.1 s before the contest it was accidentally stolen by Monokuma, and the bookworm (shūchóng, 书虫) did not have time to make up for it.
Constraints and Notes
This problem uses bundled tests.
- Subtask 1 (5 pts): .
- Subtask 2 (25 pts): .
- Subtask 3 (25 pts): .
- Subtask 4 (45 pts): no special restrictions.
For of the testdata, , , .
Postscript: You computed the answer in 0.5 s and it was correct, but when Shuichi entered the constructed number into the password dial, it was wrong. So this was a lie, and Shuichi still has to gather "truth bullets" to fight the class trial (
Translated by ChatGPT 5
京公网安备 11011102002149号