#K3301. Dividing Bananas into Even Sum Groups
Dividing Bananas into Even Sum Groups
Dividing Bananas into Even Sum Groups
You are given a set of bananas each with a certain power level. Your task is to determine whether it is possible to partition the bananas into groups such that the sum of the power levels in each group is an even number.
Let \(O\) be the number of odd integers and \(E\) be the number of even integers among the given bananas. It can be proven that the answer is "YES" if either:
- \(O \mod 2 = 0\), or
- \(O \mod 2 = 1\) and \(E > 0\).
Otherwise, the answer is "NO".
Determine the answer for each test case.
inputFormat
The first line of the input contains an integer \(T\) (\(T \ge 1\)) representing the number of test cases. The description of the test cases follows.
For each test case:
- The first line contains an integer \(n\) denoting the number of bananas.
- The second line contains \(n\) space-separated integers, where the \(i\)-th integer represents the power level of the \(i\)-th banana.
outputFormat
For each test case, output a single line with the answer: "YES" if it is possible to partition the bananas into groups such that each group has an even sum, or "NO" otherwise.
## sample5
4
1 3 2 4
3
1 1 1
5
2 2 2 2 2
2
1 3
1
1
YES
NO
YES
YES
NO
</p>