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
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
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 be the number of positive divisors of . Given , compute the exact value
Do not take the result modulo any number.
Input
The input contains .
Output
Print the exact integer .
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Example 1
Input
4
Output
23
Explanation
The divisor counts of are . Thus .
Example 2
Input
100
Output
26879
Explanation
Summing for all gives .
Example 3
Input
10000000
Output
838627288460105
Explanation
For , the exact sum is , so 64-bit integer arithmetic is necessary.