#T511. 【NOIP2001-J2】最大公约数和最小公倍数问题
【NOIP2001-J2】最大公约数和最小公倍数问题
Description
Given two positive integers x0, y0 (2 ≤ x0 < 100000, 2 ≤ y0 ≤ 1000000), find the number of pairs (P, Q) that satisfy the following conditions:
Conditions:
- P and Q are positive integers.
- P and Q have x0 as their greatest common divisor (GCD) and y0 as their least common multiple (LCM).
Determine: The number of all possible pairs of positive integers that satisfy the conditions.
Input Format
A single line containing two positive integers x0 and y0.
Output Format
A single line containing the number of valid (P, Q) pairs.
```input1 3 60 ``` ```output1 4 ``` ## HintThere are 4 possible pairs for P and Q:
- 3, 60
- 15, 12
- 12, 15
- 60, 3
For 100% of the data, 2 ≤ x₀, y₀ ≤ 10^5.
Source
NOIP2001-J2