Special Divisors
Practice
1 (1 votes)
Medium
Problem
33% Success 185 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

GCD( Greatest Common Divisor ) of two numbers x and y is the greatest number which is divisor of both x and y.

A divisor u of a positive integer n for which, \( GCD(u, n/u) = 1 \) is said to be a unitary divisor of n. For example: the divisors of 12 are {1,2,3,4,6,12}. The unitary divisors are {1,3,4,12}.

You need to find all the divisors d of a positive integer n which are special divisors. A divisor d of a positive integer n is said to be a special divisor, if the greatest common unitary divisor of d and n/d is 1.

Input:-
First line contains an integer T, denoting number of test cases.
Next T lines follows, each containing an integer N for which you need to calculate number of special divisors.

Output:-
Print T lines, each corresponding to the respective test case value of N, denoting the total number of special divisors of N.

Constraints:-
1<= T <=10
1<= N <= 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:30
1 votes
Tags:
mathsprime factorizationsieveMedium
Points:30
1 votes
Points:30
Tags:
MathematicsMediumApprovedFactorization