Submit | All submissions | Best solutions | Back to list |
Problem hidden
NUB04 - Prime Machine |
Check a number if it is prime or not.A number is called prime number if it has only 2 divisiors, 1 and the own number.2 is the smallest prime number as it has no other diviors without 1 and its own(2).
Input
Each line will contain a digit N (1<=N<=10^12) .End of will terminate the programme.
Output
If the number is prime print "YES" otherwise "NO" (without quotes).
Example
Input: 1
2
3
4
5
Output: NO
YES
YES
NO
YES
Added by: | Ruhul |
Date: | 2019-09-15 |
Time limit: | 1s-5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |