ZYB's Prime

Time Limit: 1000ms
Memory Limit: 131072KB
This problem will be judged on HDU. Original ID: 5594
64-bit integer IO format: %I64d      Java class name: Main

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

2
7
3 4 8 9 1 1 1
3
1 2 3

Sample Output

YES
NO

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .