#P1357. 花园
花园
Description
Xiao L has a circular garden. Number the flower plots from to in the clockwise direction. Plots and are adjacent.
His circular garden can have a new arrangement every day, but all arrangements must follow one rule: in any consecutive plots, there are at most plots of type "C", and all remaining plots are of type "P".
For example, if , , , then:
CCPCPPPPCCis an arrangement that does not satisfy the rule.CCPPPPCPCPis an arrangement that satisfies the rule.
Please compute the number of arrangements that satisfy the rule, modulo .
Input Format
One line containing three integers , , and .
Output Format
Output one line with a single integer, the answer.
10 5 3
458
6 2 1
18
Hint
Constraints
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号