PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000176. Số nguyên tố ghép
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ố nguyên tố ghép
Concatenated Prime Numbers
Source: VNOJ mprime
Version: Phuoc Hung OJ Extended (one dataset per execution; batched queries remain together).
Problem Statement
Let be all primes in increasing order. Concatenate each pair of consecutive primes in decimal to form ; e.g. , , , . Retain only those which themselves are prime, in original order. Find the -th retained value.
Input
One integer .
Output
Print the -th concatenated prime.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Sample Input
2
Sample Output
3137
Sample Explanation
is the first concatenated prime. The second is , formed from consecutive primes and .