#P8362. [SNOI2022] 数位
[SNOI2022] 数位
Problem Description
Little S is a girl who likes counting.
One day, she was lying in bed counting before sleep. When she counted to , she finally felt sleepy and decided to go to sleep. But then she suddenly noticed that the digits of this number are monotonically non-increasing. She found it quite interesting, and then she could not fall asleep again.
She wants to know how many numbers are between and whose digits are monotonically non-increasing. But this problem is too boring.
She then wants to know how many pairs are between and such that the digits of are monotonically non-increasing. But this problem is also too boring.
Finally, she came up with a more interesting problem:
Given integers , find how many -dimensional vectors satisfy that the digits of are monotonically non-increasing, and .
Since the answer may be very large, output it modulo .
Input Format
The first line contains a positive integer , as described in the problem statement.
The second line contains a positive integer , as described in the problem statement.
The third line contains a positive integer , as described in the problem statement.
Output Format
Output one line with one integer, the number of valid vectors modulo .
1
100
2
3728
19260817
1000000000
3
28745082
114514233
1919810233
10
135934411
样例 4 见附件 digit4.in
样例 4 见附件 digit4.ans
样例 5 见附件 digit5.in
样例 5 见附件 digit5.ans
Hint
Constraints
For all testdata, , .
The detailed constraints are given in the table below.
| Test Point | ||
|---|---|---|
Translated by ChatGPT 5