#K44342. Prime Number Checker and Batch Processor

    ID: 27510 Type: Default 1000ms 256MiB

Prime Number Checker and Batch Processor

Prime Number Checker and Batch Processor

This problem requires you to implement a prime number checker and process a list of numbers to determine for each whether it is a prime or not. 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 \( p \) is prime if for every integer \( d \) satisfying \( 1 < d < p \), it holds that \( d \nmid p \).

Your program should read an integer \( T \) representing the number of test cases, followed by \( T \) integers. For each integer, print "Prime" if the number is prime, otherwise print "Not Prime". Each result should be output on a separate line.

inputFormat

The first line of input contains a single integer \( T \) (\( T \geq 1 \)) indicating the number of test cases. This is followed by \( T \) lines, each containing one integer \( n \) (\( -\infty < n < \infty \)).

Example:

4
7
10
17
20

outputFormat

Output \( T \) lines where each line contains either "Prime" or "Not Prime" corresponding to the input number. There should be no extra spaces or blank lines in the output.

Example:

Prime
Not Prime
Prime
Not Prime
## sample
4
7
10
17
20
Prime

Not Prime Prime Not Prime

</p>