cswork / OA打开练习工作台

AmazonOA #349

Sum of All Days Numbers on Which the Data of the Xth Will Be Dependent

估计中等可在线判题

考点(AI 标注)位运算

Given n, a value x belongs to the dependency ID set if some positive integer k satisfies floor(n/k)=x. Find the sum of all distinct x in this set, counting each value only once; 0 also belongs to the set but contributes 0.

输入格式

The input is an integer n. On this site 0≤n≤10^12.

输出格式

Output a single integer, the answer.

样例 1

输入:

5

输出:

8

样例 2

输入:

0

输出:

0

样例 3

输入:

16

输出:

39

样例说明

The outputs of the three public examples are 8; 0; and 39, checked by independent enumeration or direct simulation.