#K93057. Sum of Unique Factors

    ID: 38334 Type: Default 1000ms 256MiB

Sum of Unique Factors

Sum of Unique Factors

You are given a positive integer n. Your task is to compute the sum of all unique factors (divisors) of n. A factor of n is an integer which divides n without leaving a remainder. For example, if n = 12, the factors are \(1, 2, 3, 4, 6, 12\) and their sum is \(28\). The problem may involve multiple test cases.

inputFormat

The input is read from standard input (stdin). The first line contains a single integer (T) denoting the number of test cases. Each of the following (T) lines contains one positive integer (n).

outputFormat

For each test case, output the sum of all unique factors of the given integer (n) on a separate line. The output should be printed to standard output (stdout).## sample

5
12
15
28
1
25
28

24 56 1 31

</p>