luogu#P9707. [KMOI R1] 音波武器
[KMOI R1] 音波武器
Background
In Military Operation on Planet , the fleet encountered some difficulties when capturing City .
Problem Description
Xiao Yuan’s fleet uses sonic wave weapons to attack, but the opponent’s city walls are made of a special material—Pulin (pinyin), so the sonic attacks are not very effective.
We define the weakening coefficient as follows: when a sonic wave with intensity is received, after penetrating Pulin it will be weakened to a sonic wave with intensity .
Now Xiao Yuan fires sonic waves with intensities . The opponent uses Pulin with weakening coefficient . Xiao Yuan wants to know, after weakening, what the maximum intensity among these sonic waves is.
The symbol here denotes factorial: . For example, . In particular, .
Input Format
Three positive integers , with the meanings as described above.
Output Format
One integer , representing the maximum intensity.
1 3 4
2
3 6 10
6
100 1000 911451407
911273936
Hint
Sample Explanation
The final intensities are , so output .
Sample Explanation
The final intensities are , so output .
Constraints
For of the testdata: , .
For of the testdata: , .
For of the testdata: , .
Translated by ChatGPT 5