#P17017. [GESP202606 八级] 堆石子
[GESP202606 八级] 堆石子
Problem Description
There are piles of stones, numbered , and the number of stones in each pile is denoted by , respectively.
Now we require that the st pile has exactly stones (that is, ), and that for every pile after that, the number of stones is strictly less than the previous pile, i.e. (). In addition, each pile must contain at least one stone, i.e. ().
With no restriction on the total number of stones, given and , how many stone-piling configurations satisfy the requirements?
Two configurations are different if and only if there exists at least one pile whose number of stones is different between the two configurations.
If no configuration satisfies the requirements, output . Since the number of configurations may be very large, output the result modulo .
Input Format
Input one line containing two positive integers and .
Output Format
Output one integer, representing the total number of configurations modulo .
3 5
6
Hint
Sample Explanation 1
There are a total of configurations: , , , , , and .
Constraints
::cute-table{tuack}
| Test Point ID | Constraints | Special Properties |
|---|---|---|
| None | ||
| ^ |
Translated by ChatGPT 5