DWITE '07 R1 #1 - Vanilla Primes

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
DWITE Online Computer Programming Contest, October 2007, Problem 1

In mathematics, a prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example: 2, 3, 5, 7, 11, 13, 17, 19 are the first eight prime numbers. A vanilla flavour programming problem is to figure out if a given number is a prime or not.

The input will contain a single integer. -1000 \le N \le 1000.

The output will contain a single line, stating if the supplied integer is prime or not.

Sample Input 1

-1

Sample Output 1

not

Sample Input 2

1

Sample Output 2

not

Sample Input 3

2

Sample Output 3

prime

Problem Resource: DWITE

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Comments

There are no comments at the moment.