Alice and Pairs

4.5

4 votes
Number Theory, Prime Factorization, Easy-Medium, Mathematics, Sieve, Factorization
Problem

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 xy=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:
1T105
1N107

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For 1st test case, pairs are (1,2) and (2,1)

For 2nd test case, pairs are (1,6) , (6,1) , (2,3) and (3,2).

Editor Image

?