PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000094. Dãy tổng các ước thực sự (Amazing Factor Sequence)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Dãy tổng các ước thực sự (Amazing Factor Sequence)
Amazing Factor Sequence
Source: SPOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Define . For each , let be the sum of all proper positive divisors of , i.e. positive divisors with . Define . Given , compute . For example, and .
Input
One line contains the positive integer .
Output
Print the integer .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
5
Output
6
Explanation
We have , , , and . Starting with , the running totals are , , , and . Print 6.