#abc293e. [abc293_e]Geometric Progression
[abc293_e]Geometric Progression
Problem Statement
Given integers , , and , find , modulo .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 4 7
Sample Output 1
5
, which equals modulo , so should be printed.
Sample Input 2
8 10 9
Sample Output 2
0
Sample Input 3
1000000000 1000000000000 998244353
Sample Output 3
919667211