当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7405:Prime Number

题目描述
A natural number (i.e. 1, 2, 3, 4, 5, 6, etc.) is called a prime number (or a prime) if it has exactly two positive divisors, 1 and the number itself. Natural numbers greater than 1 that are not prime are called composite.
For example, among the numbers 1 through 6, the numbers 2, 3, and 5 are the prime numbers, while 1, 4, and 6 are not prime. 
Give you a number, you need to calculate whether it is a prime number. If it meets the condition , output ‘YES’ and the following six prime number including the one which is larger. Otherwise, Output ‘NO’ and the following six number which is larger.

输入解释
The input starts with one line containing one integer T, which is the number of test cases. T test cases follow. Each case consists of one line with one integer N, which is the exact one you need to calculate.
输出解释
For each test case, output in one line.
If it is a primer number, Output ‘YES’ and the following six primer number including the one which is larger. Otherwise, Output ‘NO’ and the following six number which is larger.

输入样例
3
2
266
469
输出样例
Yes 2 3 5 7 11 13 
No 269 271 277 281 283 293 
No 479 487 491 499 503 509
提示
1 ≤ T ≤ 10000 2 ≤ N ≤ 100000

该题目包含在题集 SSPU新生赛

共提交 52

通过率 67.31%
时间上限 内存上限
1000 MS 128 MB