PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000180. Số bán nguyên tố thứ K (hai nguyên tố khác nhau)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số bán nguyên tố thứ K (hai nguyên tố khác nhau)
Bazinga!
PHOJ ID: PRIME000185
Original source: SPOJ DCEPC505
Version: PHOJ Extended, one dataset per run.
Problem statement
Consider all positive integers expressible as the product of exactly two distinct prime numbers, sorted increasingly. Given a 1-based index , output the -th such integer.
Input
A single integer .
Output
The -th number in this sequence.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Example
Input
7
Output
26
Explanation
The first seven products of two distinct primes are 6, 10, 14, 15, 21, 22, and 26, so the seventh is 26.