PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000192. Tỷ lệ giá trị nguyên tố (Prime Time)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Tỷ lệ giá trị nguyên tố (Prime Time)

Prime Time

Phuoc Hung OJ problem: PRIME000197
Reference: UVa 10200
Adaptation: one original query per PHOJ execution; subtasks are PHOJ-specific groups.

Problem statement

The polynomial f(x)=x2+x+41f(x)=x^2+x+41 generates many primes. Given integers a,ba,b, compute the percentage of integers xx in [a,b][a,b] for which f(x)f(x) is prime.

Input

One line with integers a,ba,b (one query per run).

Output

Print the percentage with exactly two digits after the decimal point, without a % sign.

Subtasks

  • Subtask 1 (20 points): 0≤a≤b≤1000\le a\le b\le100.
  • Subtask 2 (30 points): 0≤a≤b≤20000\le a\le b\le2000, b>100b>100.
  • Subtask 3 (50 points): 0≤a≤b≤100000\le a\le b\le10000, b>2000b>2000.

Example

Input

0 40

Output

97.56

Explanation: For x=0,1,…,39x=0,1,\ldots,39, f(x)f(x) is prime; for x=40x=40, f(40)=1681=412f(40)=1681=41^2 is composite. The fraction is 40/4140/41, i.e. 97.5697.56 percent.