Mr. White's Carnival

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 64M

Authors:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Navidur went to the carnival and played the stereotypical hit something with a big hammer as hard as you can. When he hit the platform, the puck flew up exactly N meters. Now, the carnival is actually hosted by Mr. White, so the scoring is a little strange this time around. Navidur's score is the sum of all the positive factors of N. What's his score?

Input Specification

The input will be a single integer N (1 \le N \le 10^6).

Output Specification

Output the sum of the positive factors of N.

Sample Input

27

Sample Output

40

Comments

There are no comments at the moment.