|
|
SPOJ Problem Set (classical)
288. Prime or Not
Problem code: PON
|
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^63-1]
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
| Added by: | Roman Sol |
| Date: | 2005-01-24 |
| Time limit: | 21s
|
| Source limit: | 5000B |
| Languages: | All except: ADA ASM BASH C# CLPS D ERL FORT ICON JAR JAVA JS LUA NEM NICE PHP PIKE ST |
| Resource: | ZCon 2005 |
|
|
|
|