PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000184. Tổng có trọng số theo số ước (Sum of Divisors)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Tổng có trọng số theo số ước (Sum of Divisors)

Sum of Divisors

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Let d(x)d(x) be the number of positive divisors of xx. Given NN, compute the exact value

S=∑k=1Nk⋅d(k).S=\sum_{k=1}^{N}k\cdot d(k).

Do not take the result modulo any number.

Input

The input contains NN.

Output

Print the exact integer SS.

Subtasks

  • Subtask 1 (20 points): 1≤N≤10001 \le N \le 1000.

  • Subtask 2 (30 points): 1≤N≤1000001 \le N \le 100000.

  • Subtask 3 (50 points): 1≤N≤100000001 \le N \le 10000000.

Examples

Example 1

Input

4

Output

23

Explanation

The divisor counts of 1,2,3,41,2,3,4 are 1,2,2,31,2,2,3. Thus S=1+4+6+12=23S=1+4+6+12=23.

Example 2

Input

100

Output

26879

Explanation

Summing k⋅d(k)k\cdot d(k) for all 1≤k≤1001\le k\le100 gives 2687926879.

Example 3

Input

10000000

Output

838627288460105

Explanation

For N=107N=10^7, the exact sum is 838627288460105838627288460105, so 64-bit integer arithmetic is necessary.