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

\(1 \le T \le 10^{6}\)

\(1 \le N \le 10^{7}\)

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

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

Editor Image

?