Snow Leopard and sum of primes
All submissions for this problem are available.
Snow Leopard has been given an integer ‘n’. Now he has to tell whether 2n can be written as a sum of two prime numbers or not.
Please help him calculate this efficiently.
The first line has a number T, indicating the number of test cases.
Next T lines contain a number 'n' each.
T lines printing “YES” or “NO” if it can be written as a sum of two prime numbers or not(w/o “”)
1<= T <= 10^6
0<= n <= 10^6
Input: 1 2 Output: YES
Case 1: Since 4 can be written as a sum of two prime numbers(2+2)
|Tags||cakewalk, maths, primenumbers, prog_iitmandi|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions