#P6358. 鬼故事 加强版
鬼故事 加强版
Description
Given , compute:
where , , and .
As a “kind-hearted” (not really) problem setter, you only need to take the answer modulo .
Input Format
Input one line with three positive integers .
Output Format
Output one line with one integer, representing the answer.
233 888 251
60539267
11451 45149 8100
728539702
114514 233333 101010
830578369
198245 285628 157293
121742791
Hint
Constraints.
For of the testdata, .
For of the testdata, .
For of the testdata, , .
Please pay attention to constant-factor optimizations.
Since setting to an arbitrary-precision range is not very meaningful, it has been changed to 10^{18} here.
Translated by ChatGPT 5
京公网安备 11011102002149号