Gone bananas
Practice
2.2 (17 votes)
Easy
Grammar Verified
Math
Number theory
Primality test
Prime number
Problem
59% Success 9141 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\)
Submissions
Please login to view your submissions
Similar Problems
Points:20
52 votes
Tags:
ApprovedEasyMathOpenPrimality test
Points:20
17 votes
Tags:
Ad-HocApprovedBasic ProgrammingEasyImplementationOpen
Points:20
524 votes
Tags:
ApprovedData StructuresEasyHiringSieve
Editorial