#P12540. [XJTUPC 2025] 离散对数
[XJTUPC 2025] 离散对数
Description
Given positive integers , , , ensure that is , find such that:
We say that integers have if and only if there exists an integer such that .
Input Format
Input is just one line of three integers , , and (), separated by a space, with the meaning as described in the question.
The data guarantees that is a prime.
Output Format
Output only one integer (). If there are multiple legal answers, you can output any one.
It can be proved that there is at least one solution in the range.
3 5 7
16
14530529 19260817 19491001
5660025
Hint
For the first sample, we have:
Because:
京公网安备 11011102002149号