atcoder#ABC212G. [ABC212G] Power Pair
[ABC212G] Power Pair
Score : points
Problem Statement
Given is a prime number .
How many pairs of integers satisfy the following conditions?
- There exists a positive integer such that .
Since the answer may be enormous, print it modulo .
Constraints
- is a prime number.
Input
Input is given from Standard Input in the following format:
Output
Print the answer modulo .
3
4
Four pairs satisfy the conditions.
11
64
998244353
329133417