Hide
Problem B
Pohlig-Hellman
Languages
en
is
Implement the Pohlig-Hellman algorithm to solve
Input
Input is three lines. The first line contains the prime
Output
Output one line with any valid solution
Sample Input 1 | Sample Output 1 |
---|---|
3 2 1 |
0 |
Sample Input 2 | Sample Output 2 |
---|---|
449 6 99 |
182 |
Sample Input 3 | Sample Output 3 |
---|---|
7 4 3 |
no solution |