A prime number is a whole number greater than whose only factors are
and itself.
Advanced hint: To speed up your program you can make use of
the fact that divisors come in pairs. That is if an integer
divides an integer
, then also divides
. Also note that as
becomes larger,
becomes
smaller.
Input
Input consists of one line containing one integer
, where .
Output
Output prime if is prime, otherwise output
not prime.
Sample Input 1 |
Sample Output 1 |
1
|
not prime
|
Sample Input 2 |
Sample Output 2 |
2
|
prime
|
Sample Input 3 |
Sample Output 3 |
6
|
not prime
|
Sample Input 4 |
Sample Output 4 |
7
|
prime
|
Sample Input 5 |
Sample Output 5 |
13
|
prime
|
Sample Input 6 |
Sample Output 6 |
23
|
prime
|
Sample Input 7 |
Sample Output 7 |
25
|
not prime
|