This page is still under construction.

Parts of this page are still being built. What you see may change.

Sum of Divisors

Interview

Time limit1sMemory limit256 MB

Summary
Given a natural number n up to 10000, print the sum of all its positive divisors, with 1 and n included.
Level

Easy2 of 10

Topics
Math, Brute force
Solved
No attempts yet

Problem

You are given a natural number nn. Find the sum of all divisors of nn. A divisor is a positive integer that divides nn with no remainder, and both 1 and nn count as divisors.

Input

The first line contains a natural number nn (1≤n≤100001 \le n \le 10000).

Output

Print the sum of all divisors of nn on the first line.

Examples5

  1. Example 1

    Input
    5
    
    Expected output
    6
    
  2. Example 2

    Input
    1
    
    Expected output
    1
    
  3. Example 3

    Input
    6
    
    Expected output
    12
    
  4. Example 4

    Input
    10000
    
    Expected output
    24211
    
  5. Example 5

    Input
    9973
    
    Expected output
    9974