PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000082. Tổng các số có ước thực sự lớn nhất bằng K (Count N)
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ác số có ước thực sự lớn nhất bằng K (Count N)
Count N
Source: CodeChef
Version: Phuoc Hung OJ Extended
Problem Statement
For a positive integer , let be the greatest positive divisor strictly smaller than , with . Given , compute the sum of all positive integers such that . Use a -bit integer for the answer.
Input
One line containing the integer .
Output
Print one integer: the required sum.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
6
Output
12
Explanation
For , its smallest prime divisor is . The only valid number is : the greatest proper divisor of is . Hence the answer is .