PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000063. Sai số của Định lý số nguyên tố (Prime Number Theorem)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Sai số của Định lý số nguyên tố (Prime Number Theorem)
Prime Number Theorem
Source: SPOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Let count the primes not exceeding integer . The Prime Number Theorem motivates the approximation , with the natural logarithm. Given , compute its relative percentage error: $$E(x)=100\cdot\frac{|\pi(x)-x/\ln x|}{\pi(x)}.$$ Round the result to exactly one decimal place.
Input
One line contains integer . The terminating value from the original multi-case format is omitted.
Output
Print the percentage error as one real number with exactly one digit after the decimal point.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
10000000
Output
6.6
Explanation
For , , while . The relative error is approximately , which rounds to 6.6.