Gone bananas
Practice
2.2 (17 votes)
Easy
Grammar Verified
Math
Number theory
Primality test
Prime number
Problem
59% Success 9197 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You are required to distribute N bananas among some people according to the following conditions:

  • You can select the number of people that receive bananas.
  • Each person should get more than one banana.
  • One person cannot receive all the bananas.
  • All the N bananas must be distributed.
  • Each person can only receive an integral number of bananas.

Write a program to determine whether the bananas can be distributed among the people.

Input format

  • First line: T denoting the number of test cases
  • Next T lines: N

Output format

For each test case, print Yes or No depending upon the result.

Constraints

2T105
1N106

Sample Input
2
2
4
Sample Output
No
Yes
Explanation

Explanation of the first test case:
2 bananas cannot be distributed among a group of any size. Suppose a group of size 1 is considered, then one person takes all the bananas. If a group of size 2, then each person get only 1 banana that violates the rule of distribution.
Explanation of the second test case:
4 bananas can be equally distributed among 2 people where each person gets 2 bananas.

Code Editor

Please login to use the editor

You need to be logged in to access the code editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
114 votes
Tags:
EasyMathNumber TheoryPrimality test
Points:20
8 votes
Tags:
ApprovedEasyHiringMathPrimality testSieve
Points:20
22 votes
Tags:
ApprovedEasyMathOpenPrimality test
Editorial

Login to unlock the editorial