Number of pairs

3.8

10 votes
Integer Factorization, Algorithms, Math, Mathamatics, Factorization, Number Theory
Problem

You are given an integer which is a product of LCM and GCD. Your task is to find all the pairs of x and y for which their product of LCM and GCD is equal to the given number.

Note: Pair x and y is different from y and x.

Input format

  • The first line of the input contains a single integer T denoting the number of test cases.
  • The first and only line of each test case contains a single Integer.

Output format

For each test case, print a single line containing the Integer.

Constraints

1T100
1N4×109

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

For test input 1, N= 1,  only pair is (1, 1).

For test input 2, N = 2, pair will be (1, 2) and (2, 1).

For test input 3, N = 16, pair will be (1, 16), (2, 8), (4, 4), (8, 2), (16, 1).

Editor Image

?