Let's Count
Practice
3.6 (189 votes)
Ready
Mathematics
Approved
Easy
Number theory
Problem
52% Success 5032 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

While Omar was studying for Math lectures, he found the following problem.
Given 3 Integers \(N_1\), \(N_2\), \(N_3\), count the number of common divisors which divide all of them.

Can you please help Omar in solving this problem, because he usually sleeps in lectures.

Input:

Given an integer T, which indicates the number of test cases.
For each test case: given 3 separated integers \(N_1, N_2, N_3\).

Output:

For each test case: print the number of common divisors which divide \(N_1, N_2, N_3\). Print each case in a separate line.

** Constraints:**

\(1 \le T \le 50\)
\(1 \le minimum\; (N_1, N_2 , N_3) \le 10 ^ {12}\)
\(1 \le maximum\; (N_1, N_2 , N_3) \le 10 ^ {18}\)

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
19 votes
Tags:
Basic ProgrammingBasics of ImplementationEasyImplementation
Points:50
4 votes
Tags:
AlgorithmsCombinatoricsFast Fourier transformHard
Points:30
55 votes
Tags:
ApprovedData StructuresDisjoint setMediumOpen
Editorial

No editorial available for this problem.