All Tracks Math Number Theory Primality Tests Problem

Pairwise Products
/

Mathematics, Number Theory, Primality test

Problem
Editorial
Analytics

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}\)

SAMPLE INPUT
2
4
5
SAMPLE OUTPUT
14
5
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\) 

Time Limit: 5.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

This Problem was Asked in

Initializing Code Editor...
Notifications
View All Notifications

?