Gone bananas
Practice
2.2 (17 votes)
Easy
Grammar Verified
Math
Number theory
Primality test
Prime number
Problem
59% Success 9176 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
\(2 \le T \le 10^5\)
\(1 \le N \le 10^6\)
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
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
17 votes
Tags:
Ad-HocApprovedBasic ProgrammingEasyImplementationOpen
Points:20
26 votes
Tags:
EasyMathPrimality test
Points:20
8 votes
Tags:
ApprovedEasyHiringMathPrimality testSieve
Editorial
Login to unlock the editorial