You are given a number N. Your task is to determine if N is an amazing number or not. A number is called amazing if it has exactly three distinct divisors.

**Input:**

The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows. Each testcase contains a single line having N as input.

**Output:**

For each testcase, print 1 if the number is amazing, else print 0.

**Constraints:**

1<=T<=1112

2<=N<=10^{18}

**Example:**

**Input:**

3

2

3

4

**Output:**

0

0

1

**Explanation:**

For testcase 1: 2 has the following divisors: 1, 2. Only 2 divisors, so we print 0.

For testcase 2: 3 has the following divisors: 1, 3. Only 2 divisors, so we print 0.

For testcase 3: 4 has the following divisors: 1, 2,4. Exactly 3 divisors, so we print 1.

Author: Soul_xhacker

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

bhatabhi554 | 317 |

hardikJain5 | 306 |

CodeBuddy | 293 |

Akkki111 | 233 |

clone | 230 |

KshatriyaYash | 1932 |

nikhil_sojan | 1374 |

lonecoder | 1236 |

mazumderrohit8 | 1176 |

RemoveTLE | 1144 |

blackshadows | 5327 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4605 |

Quandray | 4444 |

Login to report an issue on this page.