Welcome To SDIBT ACM-ICPC Online Judge

VIRTUAL JUDGE Recent Contest F.A.Qs Forum Home ProblemSet Status Ranklist 17 Contest LoginRegister Exam
Problem 1185. -- Divisor Summation

Divisor Summation

Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 742  Solved: 168
[Submit][Status][Forum]

Description

Give a natural number n (1 <= n <= 500000), please tell the summation of all its proper divisors. Definition: A proper divisor of a natural number is the divisor that is strictly less than the number. e.g. number 20 has 5 proper divisors: 1, 2, 4, 5, 10, and the divisor summation is: 1 + 2 + 4 + 5 + 10 = 22.

Input

An integer stating the number of test cases, and that many lines follow each containing one integer between 1 and 500000.

Output

One integer each line: the divisor summation of the integer given respectively.

Sample Input

3
2
10
20

Sample Output

1
8
22

HINT

zoj2095

Source

[Submit][Status][Forum]

HOME Back

한국어 中文 English
All Copyright Reserved 2008-2010 SDIBT TEAM
GPL2.0 2003-2010 HUSTOJ Project TEAM
Anything about the Problems, Please Contact Admin:admin