[Solution] Parity CodeChef Solution | Solution CodeChef
Problem
Ashu and Arvind participated in a coding contest, as a result of which they received chocolates. Now they want to divide the chocolates between them equally.
Can you help them by deciding if it is possible for them to divide all the chocolates in such a way that they each get an equal number of chocolates?
You cannot break a chocolate in two or more pieces.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first and only line of each test case contains a single integer — the number of chocolates they received.
Output Format
For each test case output the answer on a new line — "Yes" (without quotes) if they can divide chocolates between them equally, and "No" (without quotes) otherwise.
Each letter of the output may be printed in either uppercase or lowercase, i.e, "Yes", "YES", and "yEs" will all be treated as equivalent.
Explanation:
Test case : They can divide chocolates such that both of them get chocolates each.
Test case : They can divide chocolates such that both of them get chocolates each.
Test case : There is no way to divide chocolates so that they get equal number of chocolates.
Test case : They can divide chocolates such that both of them get chocolate each.
No comments:
Post a Comment