Hide

Problem G
Prime Number

Accepted submissions to this problem will be granted a score of 100

A prime number is a whole number greater than 1 whose only factors are 1 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 i divides an integer n, then ni also divides n. Also note that as i becomes larger, ni becomes smaller.

Input

Input consists of one line containing one integer n, where 1n106.

Output

Output prime if n 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
Hide

Please log in to submit a solution to this problem

Log in