All problems
Check Prime Number
easyPythonMath
A hall is being laid out for an exam and the invigilator wants to know whether the desks can be arranged in a rectangle wider than one desk. If the number of desks is prime, the only rectangle available is one long row. A prime number is a whole number above 1 whose only whole divisors are 1 and itself.
Task: Read the number of desks and report whether it is prime.
Input
A single line holding one integer n, with 1 ≤ n ≤ 1,000,000.
Output
One line holding exactly Prime or exactly Not Prime — capital P, capital N, a single space in Not Prime, nothing else.
Example:
Input:
17
Output:
Prime
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in