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 and B, find the count of divisors of which also divides B.

Input

  • First line contains an integer T which denotes the number of testcases.
  • Next T lines contains two integers 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.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
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.