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}\)
Submissions
Please login to view your submissions
Similar Problems
Points:50
1 votes
Tags:
Euler's totient functionHardMathNumber Theory
Points:20
154 votes
Tags:
Number TheoryEasyReadyMathematicsOpenApprovedFactorization
Points:30
6 votes
Tags:
Breadth First SearchDynamic ProgrammingMedium
Editorial
No editorial available for this problem.