CodechefJul 30, 2025

Parity

Hazrat Ali

Codechef

Can you help them by deciding if it is possible for them to divide all the N 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 T, denoting the number of test cases.
  • The first and only line of each test case contains a single integer N — 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.

Constraints

  • 1≤T≤10
  • 1≤N≤10

Sample 1:

Input
4
10
4
3
2
Output
 
Yes
Yes
No
Yes

Solution

T = int(input())

for _ in range(T):
    N = int(input())
    if N % 2 == 0:
        print("Yes")
    else:
        print("No")




Comments