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
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
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 generates many primes. Given integers , compute the percentage of integers in for which is prime.
Input
One line with integers (one query per run).
Output
Print the percentage with exactly two digits after the decimal point, without a % sign.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): , .
- Subtask 3 (50 points): , .
Example
Input
0 40
Output
97.56
Explanation: For , is prime; for , is composite. The fraction is , i.e. percent.