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
In test case 2,
n = 24
The divisors of 24 are {1,2,3,4,6,8,12,24}, unitary divisors are {1,3,8,24} while special divisors are {1,2,3,4,6,8,12,24}.
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
Login to unlock the editorial
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