PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000260. Riemann và Mertens (Riemann vs Mertens)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Riemann và Mertens (Riemann vs Mertens)
Riemann vs Mertens
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
The Möbius function satisfies , equals when is divisible by a prime square, and otherwise equals , where counts the distinct prime factors of . The Mertens function is . Determine both values at .
Input
Read one integer .
Output
Print three right-aligned fields on one line: , and , each with width 8 and without additional separators.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Example 1
Input
20
Output
20 0 -3
Explanation
The factorization is . Thus , and summing for gives .
Example 2
Input
1
Output
1 1 1
Explanation
The factorization is . Thus , and summing for gives .
Example 3
Input
144
Output
144 0 -1
Explanation
The factorization is . Thus , and summing for gives .
Example 4
Input
73
Output
73 -1 -4
Explanation
The factorization is . Thus , and summing for gives .