#P3702. [SDOI2017] 序列计数
[SDOI2017] 序列计数
Description
Alice wants to obtain a sequence of length , where all elements are positive integers not exceeding , and the sum of these numbers is a multiple of .
Alice also wants at least one of these numbers to be a prime number.
Alice wants to know how many sequences satisfy her requirements.
Input Format
One line with three integers, .
Output Format
One line with a single number: the number of sequences that satisfy Alice’s requirements, taken modulo .
3 5 3
33
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, $1 \leq n \leq 10^9, 1 \leq m \leq 2 \times 10^7, 1 \leq p \leq 100$.
Translated by ChatGPT 5
京公网安备 11011102002149号