atcoder#ABC206E. [ABC206E] Divide Both
[ABC206E] Divide Both
Score : points
Problem Statement
Given integers and , find the number of pairs of integers satisfying all of the conditions below:
- Let be the greatest common divisor of and . Then, the following holds.- , , and .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer as an integer.
3 7
2
Let us take some number of pairs of integers, for example.
- satisfies the conditions.
- has and thus violates the condition.
- has and thus violates the condition.
There are two pairs satisfying the conditions: .
4 10
12
1 1000000
392047955148