Problems
GCD and LCM
GCD and LCM
Given two positive integers A
and B
. Find the number of pairs of numbers (P, Q)
, which for them is A
- GCD(P, Q)
, and B
- LCM(P, Q)
.
Input
In a single line two positive integers A
and B
(A < 105
, B ≤ 106
).
Output
Single number - the required number of pairs.
Input example #1
3 60
Output example #1
4