#C5301. Prime Number Checker
Prime Number Checker
Prime Number Checker
This problem requires you to determine whether a given integer is a prime number. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. In mathematical notation, a number \( n \) is prime if and only if \( n > 1 \) and for every divisor \( d \) (with \( d \in \mathbb{N} \)), \( d\mid n \) implies \( d = 1 \) or \( d = n \).
You will be given a sequence of space-separated integers as input. Your task is to print "Prime" if the number is prime, or "Not Prime" otherwise, processing numbers until the termination signal -1 is encountered. Note that -1 is not to be processed.
This problem tests your implementation of basic number theory and input/output handling.
inputFormat
The input consists of a single line containing space-separated integers. The sequence is terminated by -1, which should not be processed.
outputFormat
For each integer read before -1, output "Prime" if the integer is a prime number, otherwise output "Not Prime". Each result should be printed on its own line.## sample
11 15 18 23 -1
Prime
Not Prime
Not Prime
Prime
</p>