|
||||||||||
ZYB's PrimeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 278 Accepted Submission(s): 69 Problem Description After getting $600$ scores in $NOIP$,$ZYB(ZJ-267)$ creates a problem:you are given $N$ numbers,now you are asked to divide them into $K$ groupsŁ¨$K \geq 1$),the number of each group must be no less than $3$,and put all the numbers in a group into a ring,the sum of every two adjacent numbers must be a prime.$ZYB$ want to ask you whether the $N$ numbers can be divided or not? Input In the first line there is the testcase $T$. For each teatcase: In the first line there is one number $N$. In the next line there are N numbers $A_i$. $1 \leq T \leq 50$,$1 \leq N \leq 200$,$1 \leq A_i \leq 200$,for $60$% cases $N \leq 20$. Output For each testcase,print the $YES$ or $NO$. Sample Input
Sample Output
Source | ||||||||||
|