Geography Class

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 1.0s
Memory limit: 512M

Author:
Problem types

Tommy, feeling sleepy during geography class, decides to work on his math homework to help him stay awake. However, upon opening his homework, he is taken aback by the difficulty of the problems. Unable to solve them, he seeks your assistance and asks you to solve them for him.

Given N integers, a1,a2,,aN, his homework asks him to calculate the sum of the squares of the factors of each integer.

Constraints

SubtaskPointsNai
1201N3×1031ai105
2801N1061ai105

Input Specification

The first line of input contains an integer, N.

The following N lines each contains an integer, ai.

Output Specification

For each given number, output the sum of the squares of the factors of it.

Sample Input

Copy
2
3
5

Sample Output

Copy
10
26

Comments

There are no comments at the moment.