#abc206e. [abc206_e]Divide Both
[abc206_e]Divide Both
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.
Sample Input 1
3 7
Sample Output 1
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: .
Sample Input 2
4 10
Sample Output 2
12
Sample Input 3
1 1000000
Sample Output 3
392047955148