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

Bài tập thuộc lộ trình

1 lộ trình

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 π(x)\pi(x) count the primes not exceeding integer xx. The Prime Number Theorem motivates the approximation x/ln⁡xx/\ln x, with ln⁡\ln the natural logarithm. Given x≥2x\ge2, 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 xx. The terminating value 00 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): 2≤x≤100002\le x\le 10000.
  • Subtask 2 (30 points): 2≤x≤10000002\le x\le 1000000.
  • Subtask 3 (50 points): 2≤x≤1000000002\le x\le 100000000.

Examples

Input

10000000

Output

6.6

Explanation

For x=107x=10^7, π(x)=664579\pi(x)=664579, while x/ln⁡x≈620420.688x/\ln x\approx620420.688. The relative error is approximately 100(664579−620420.688)/664579≈6.6446%100(664579-620420.688)/664579\approx6.6446\%, which rounds to 6.6.