PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000086. Hàm số kỳ lạ (Strange Function)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Hàm số kỳ lạ (Strange Function)
Strange Function
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
For every positive integer , let be the smallest positive integer that does not divide . For example, , since both and divide but does not. Given a positive integer , compute modulo .
Input
One line containing an integer .
Output
Print the required sum modulo .
Subtasks
- Subtask 1 (20 points):
- Subtask 2 (30 points):
- Subtask 3 (50 points):
Examples
Input
10
Output
26
Explanation
For , the values of are . Their sum is .