cswork / OA打开练习工作台

AmazonOA #194

Get Data Dependence Sum (Fungible :)

估计中等可在线判题

考点(AI 标注)位运算

Given n, collect every distinct x with 0≤x<n for which some positive integer k satisfies floor(n/k)=x, and find their sum. The original snapshot explicitly requires x<n, so the value n produced by k=1 must be excluded; 0 belongs to the set but does not affect the sum.

输入格式

One line containing an integer n, 1≤n≤10^10.

输出格式

Output a single integer, the answer.

样例 1

输入:

1

输出:

0

样例 2

输入:

5

输出:

3

样例 3

输入:

10

输出:

11

样例说明

The answers are 0; 1+2=3; 1+2+3+5=11.