All Problems
mediumFunctions

Prime Number Check

Problem Statement
Determine if a given number n is prime. Print "Prime" or "Not Prime".

SAMPLE INPUT

17

SAMPLE OUTPUT

Prime

CONSTRAINTS

  • 2 <= n <= 10^6

Explanation: Check divisibility from 2 to sqrt(n).

Code Editor
Output
Click "Run" to see output...