PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000266. Tổng hàm phi Euler (Sum of Totient 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
Tổng hàm phi Euler (Sum of Totient Function)
Sum of Totient Function
Source: Library Checker
Version: Phuoc Hung OJ Extended
Problem Statement
Euler’s totient function counts the integers satisfying and . In particular, . Given a positive integer , compute modulo .
Input
One line contains the positive integer .
Output
Print one integer: the required sum modulo .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
5
Output
10
Explanation
For , , , , , and . Their sum is , so the output is 10.