Write a function that returns the sum of the divisors of a number n.
For instance, the sum of the divisors of 28 is 1+2+4+7+14+28 = 56.
Interface
C++,C | int sum_divisors(int x); |
Java | public static int sumDivisors(int x); |
Python | sum_divisors(x) # returns int |
sum_divisors(x: int) -> int |
Precondition
1 ≤ n ≤ 108.
Observation You only need to submit the required procedure; your main program will be ignored.
Input/Output