Prime number

3.8

6 votes
Easy-Medium
Problem

Given an integer(N), write a code to check if it is prime or not.

Input Format:
First line has an integer T - number of test cases.
Each test case is in a new line with a single integer N.

Output Format:
Print "prime" if N is prime, "composite" if N is not a prime. Answer for each test case should be printed in a new line.

Constraints:

  • 2T100
  • 1N1016
Time Limit: 3
Memory Limit: 256
Source Limit:
Editor Image

?