[USACO 2007 Jan L]Factors
题号:NC25046
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

Integers greater than 1 have more than one factor: a factor is a number that divides evenly into an integer. The number 6 has factors of 1, 2, 3, and 6. Ignoring the number 6 itself, it's interesting to note that 1+2+3=6, which makes 6 a "perfect number". The number 14 has factors 1, 2, 7, and 14. Their sum (ignoring 14 itself) is 10.
In the ongoing quest for perfect numbers, write a program that reads a single integer (1 <= N <= 10,000,000) and prints the sum of its factors (not including the number itself).

输入描述:

Line 1: A single integer, N

输出描述:

Line 1: A single integer that is the sum of the factors of N (not including N itself)
示例1

输入

复制
314

输出

复制
160