Alice and Pairs
Practice
4.5 (4 votes)
Number theory
Prime factorization
Easy Medium
Mathematics
Sieve
Factorization
Problem
59% Success 3420 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Alice is very good in mathematics. So, his teacher gave him a number N and wants from him to count total number of pairs, such that \(gcd( x ,y )=1\) and \(x*y=N\), where \((x, y)\) forms a pair.

Alice is very busy in his exams and he wants your help .So solve this problem for Alice.

Input:
Input starts with a number T and then follows T lines contains a single number, N.

Output:
Find the total number of pairs, and print the required answer in a new line.

Constraints:
\(1 \le T \le 10^5\)
\(1 \le N \le 10^7\)

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:30
6 votes
Tags:
Easy-Medium
Points:30
11 votes
Tags:
Prime FactorizationEasy-MediumMathematics
Points:30
1 votes
Tags:
Dynamic ProgrammingPrime FactorizationEasy-MediumMathematicsGame TheoryFactorization