多重质数
Background
When the two elves were grinding the old-age room, they found that it was not easy. They had to make many prime number judgments. Please help them finish grinding the old-age room quickly.
两个小精灵在磨养老房的时候,发现并不是很容易,要进行多次的质数判断,请你帮他们竟快磨完养老房
Description
There are 2~n integers. within this range, if it is a prime number, yes is output, and if it is a non-prime number, no (one row in total) is output. next, the number of prime numbers (a) and the number of non-prime numbers (b) between these 2~n are counted and not output. Then one operation is carried out to judge whether b*a is a prime number, if so, the values of yes and b*a are output, if not, the penultimate digits of no and b*a are output.
有2~n个整数,在这个范围内,是质数则输出yes,是非质数则输出no(共占一行),接下来统计这2~n之间质数的个数(a)和非质数的个数(b),不输出。然后一次操作,判断b*a是否为质数,是质数则输出yes和b*a的值,如果不是则输出no和b*a的倒数第二位数字。
Input
A total of one line, an integer n, representing 2~n integers.
共一行,一个整数n,表示2~n个整数。
Output
In the first row, n-1 combinations of yes and no, the first value in the second row is yes or no, and the second number is the penultimate digit of b*a or b * a.
第一行n-1个yes和no的组合,第二行第一个值为yes或者no,第二个数为b*a或b*a倒数第二位的数字。
Sample 1
Input
5
Output
yes yes no yes
yes 3
Sample 2
Input
6
Output
yes yes no yes no
no 0
Limitation
对于10%的数据n<=100;
对于40%的数据100<n<=1000;
对于50%的数据1000<n<10000;