Problem list
Log in
#r03098 · Online Judge > GoldOJ

Sum of Divisors (Large)

Bronze I 2.0 s 256 MB

Given an integer $N$ (up to $10^9$), print the sum of all divisors of $N$. Use a square-root scan over divisor pairs.

Input

One integer $N$ ($1 \le N \le 10^9$).

Output

Print the sum of the divisors of $N$.

Example 1

Input
10
Output
18

Example 2

Input
1
Output
1
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code