#K93952. Even Sum Subset
Even Sum Subset
Even Sum Subset
You are given T test cases. For each test case, you are provided an integer n denoting the number of chemicals and a list of n integers representing the potency of each chemical.
Your task is to determine whether it is possible to select a non-empty subset of these chemicals such that the sum of their potency values is even. According to the problem constraints, this is possible if and only if at least one chemical has an even potency value.
In other words, for each test case, output YES
if there exists at least one even number in the list; otherwise, print NO
.
Note: The answer is based on the property that the sum of any subset containing an even number is even, regardless of the parity of the other numbers.
Mathematically, a chemical with potency a is even if and only if $$a \equiv 0 \pmod{2}.$$
inputFormat
The first line contains a single integer T representing the number of test cases.
For each test case:
- The first line contains an integer n, the number of chemicals.
- The second line contains n space-separated integers, each representing the potency value of a chemical.
Input is read from standard input (stdin).
outputFormat
For each test case, output a single line containing either YES
or NO
(without quotes) according to the possibility of selecting a subset with an even sum.
Output is written to standard output (stdout).
## sample3
4
1 3 5 7
3
4 6 8
2
2 9
NO
YES
YES
</p>