All Tracks Math Number Theory Primality Tests Problem

Pairwise Products
Tag(s):

Math, 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
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, C++17, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, Java 14, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, Python 3.8, R(RScript), Racket, Ruby, Rust, Scala, Swift-4.1, Swift, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

Johnson & Johnson

Challenge Name

3 Address Code - On site Hackathon - Finals

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications

?