PON  Prime or Not
Given the number, you are to answer the question: "Is it prime?"
Solutions to this problem can be submitted in C, C++, Pascal, Perl, Python, Ruby, Lisp, Hask, Ocaml, Prolog, Whitespace, Brainf**k and Intercal only.
Input
t – the number of test cases, then t test cases follows. [t <= 500]
Each line contains one integer: N [2 <= N <= 2^631]
Output
For each test case output string "YES" if given number is prime and "NO" otherwise.
Example
Input: 5 2 3 4 5 6 Output: YES YES NO YES NO
hide comments
mostasim:
20160518 17:08:33
why i'm getting runtime error with prime sieve algo :( 

ov3rk1ll:
20160324 10:43:47
take care of integer overflow 

rishi_devan:
20160314 13:45:52
Submitted once  Wrong Answer.


KAUSHAL AGRAWAL:
20160227 13:40:23
so crazy time limit! distribute this time to other problems :P 

singh1495:
20160226 13:04:56
plz tell me where my code is wrong 

pvsmpraveen:
20160203 16:38:01
Done with MillerRabin Primality Test !!


cruisedevice:
20160101 21:40:27
Why we cannot solve it by simple method? 

dwij28:
20150828 00:26:45
My first ever implementation of Miller Rabin. Learnt a lot. :) 

Mohit Rathore:
20150826 16:11:57
http://www.spoj.com/problems/ZSUM/ Solve this first! 

SangKuan:
20150703 14:28:27
AC but still do not understand then Miller rabin 
Added by:  Roman Sol 
Date:  20050124 
Time limit:  21s 
Source limit:  5000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ADA ASM BASH C# CLPS D ERL FORT ICON JAVA JS LUA NEM NICE PHP PIKE ST 
Resource:  ZCon 2005 