PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000139. Tổng số nguyên tố ít nhất (Easy Problem of Prime)
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ổng số nguyên tố ít nhất (Easy Problem of Prime)
Easy Problem of Prime
Source: Codeforces Gym — 104366M
Version: Phước Hưng OJ Extended; one input file per judge run.
Problem Statement
Let be the minimum number of primes (repetition allowed) whose sum equals . For each of the queries , output . Keep all queries in one input to share preprocessing.
Input
First line contains , followed by integers .
Output
Print one result per query, in the same order.
Subtask
- Subtask 1 (20 points): , .
- Subtask 2 (30 points): , .
- Subtask 3 (50 points): , .
Example
Input
3
3
4
5
Output
2
4
5
Explanation
The example follows the mathematical conditions and the specified output format.