atcoder#ARC125B. [ARC125B] Squares
[ARC125B] Squares
Score : points
Problem Statement
You are given an integer . Find the number of pairs of integers that satisfy the following conditions, modulo .
- .
- is a square number. (Assume is also a square number.)
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3
2
We have the following two pairs.
10
8
10000000000
52583544