5.3 🌟 🔢 Counting Good Pairs 🔢 🌟
You are given 2 integers l and r
You need to find the number of good pairs
A pair (a, b) is good if l <= a, b <= r and gcd(a, b) == x and lcm(a, b) == y
Constraints
values accepted as integers (all less than 10^9)
Input Format
Output Format
Example 1
Input:
1 12 1 12
Output:
4
Explanation:
Number of pairs -> (1, 12), (12, 1), (3, 4), (4, 3)
Log In to solve the Question