#P3383. 【模板】线性筛素数
【模板】线性筛素数
Description
Given an upper bound and queries, for each query output the -th smallest prime number.
Input Format
The first line contains two positive integers , representing the query range and the number of queries.
Each of the next lines contains a positive integer , asking for the -th smallest prime.
Output Format
Output lines, each containing a single integer as the answer.
100 5
1
2
3
4
5
2
3
5
7
11
Hint
Constraints
For of the testdata, , , and it is guaranteed that the requested primes do not exceed .
Data by NaCly_Fish.
Translated by ChatGPT 5
京公网安备 11011102002149号