Chandu and his Interns
Practice
3.7 (154 votes)
Number theory
Easy
Ready
Mathematics
Open
Approved
Factorization
Problem
91% Success 26136 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Chandu is a very strict mentor. He always gives a lot of work to his interns. So his interns decided to kill him. There is a party in the office on Saturday Night, and the interns decided to kill him on the same day. In the party, there are N beer bottles. Each bottle has a integer X written on it. Interns decided to mix poison in some of the beer bottles. They made a plan that they will add poison into a bottle only if the integer on the beer bottle has number of divisors strictly less than 4. Chandu came to know about the plan of the interns. So he needs to your help to save his life. Tell Chandu if he can drink the beer or not.

Input:
First line of contains an integer N, denoting the number of bottles.
Each test case contains an integer X, denoting the number on the beer bottle.

Output:
For each beer bottle, print YES if Chandu can drink that beer, otherwise print NO.

Constraints:
1 <= N <= 105
1 <= X <= 107

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
6 votes
Tags:
Easy
Points:20
132 votes
Tags:
Number TheoryEasyMathematicsOpenApprovedFactorization
Points:20
Tags:
Binary search algorithmSortingNumber TheoryEasyMathematicsFactorization