Pairwise Products

3.3

3 votes
Math, Medium, Number Theory, Primality test
Problem

Misha is given a number N. You are required to help Misha determine the summation of the pairwise product of its divisors.

Input format

  • First line: T denoting the test cases
  • Next T lines: N 

Output format

Print the answer for each test case in a separate line.
Constraints

1T106

1N107

Sample Input
2
4
5
Sample Output
14
5
Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

Sample Case 1: 4 has three divisors - {1,2,4}. Pairwise summation of divisors will be (1×2)+(2×4)+(1×4)=14
Sample Case 2: 5 has three divisors - {1,5} . Pairwise summation of divisors will be 1×5=5 

Editor Image

?