#K64457. Sum of Divisors

    ID: 31979 Type: Default 1000ms 256MiB

Sum of Divisors

Sum of Divisors

Given a positive integer \(M\), compute \(\sigma(M)\), the sum of all positive divisors of \(M\). A divisor \(d\) of \(M\) is an integer such that \(M \bmod d = 0\). For example, if \(M = 12\), its divisors are 1, 2, 3, 4, 6, and 12, and their sum is 28.

Your task is to write a program that reads an integer from standard input and outputs the sum of all its divisors to standard output.

Note: Use an efficient approach to handle large inputs (e.g., \(M\) can be as large as 1,000,000).

inputFormat

The input consists of a single integer \(M\) provided via standard input.

outputFormat

Output a single integer: the sum of all positive divisors of \(M\) printed to standard output.

## sample
12
28

</p>