#P4463. [集训队互测 2012] calc
[集训队互测 2012] calc
Description
A sequence is valid if and only if:
- are all integers in .
- are pairwise distinct.
The value of a sequence is defined as the product of all its numbers, i.e., .
Compute the sum of the values of all distinct valid sequences, modulo . Two sequences are different if and only if they differ at any position.
Input Format
One line with three positive integers , as described above.
Output Format
One line with the result.
9 7 10007
3611
Hint
Constraints
For of the testdata, , .
For of the testdata, , .
For of the testdata, , .
For of the testdata, , , , it is guaranteed that is prime and .
by WJMZBMR
thinks the testdata for this problem is too weak, so he made a harder version.
Translated by ChatGPT 5
京公网安备 11011102002149号