B.Common Divisors
Practice
4.5 (2 votes)
Problem
18% Success 592 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Given two integers A and B, find the count of divisors of A which also divides B.
Input
- First line contains an integer T which denotes the number of testcases.
- Next T lines contains two integers A and B.
Output
Print the count of common divisors on a new line.
Constraints
- 1 <= T <= 500000
- 1 <= A, B <= 1000000
Note: Large input/Output files, so use scanf/printf.
Submissions
Please login to view your submissions
Similar Problems
Points:20
1 votes
Tags:
Math
Points:20
Tags:
MathBinary Search
Points:50
13 votes
Tags:
AlgorithmsApprovedHardOpenTrees
Editorial
No editorial available for this problem.