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).
Specifications
Input
In a single line two positive integers A and B (A < 105, B ≤ 106).
Output
Single number - the required number of pairs.
Problem information
Time Limit: 1 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 22% 73/94
Classes: Number theory, GCD, LCM
Example
Example input3 60 |
Example output4 |
| ← Least Common Multiple | Problems | Island of Misfortune → |
