Set
Time Limit: 3 sec
The Problem
In mathematics, a set is a well-defined collection of distinct objects, considered as an object in its own right. For example, the numbers 2, 4, and 6 are distinct objects when considered separately, but when they are considered collectively they form a single set of size three, written {2, 4, 6}. Sets are one of the most fundamental concepts in mathematics. Well, Now you are familiar with set. Right?
OK! In this problem you are given a set of integers. You have to determine whether the given set can be partitioned into two subsets such that the sum of elements in both subsets is same.
For example, {4, 9, 5, 11, 7} is a Set.
This set can be partitioned as {4, 5, 9} and {7, 11} where, sum of both sets are equal.
The Input
The first line of input will be the no of test cases T, then T test cases followed. The first line of each test case contains an integer N, where N is the number of elements in a set. Then in the next line contains N space separated integers. You can assume that no operation overflows a 32-bit integer.
The Output
For each test case print YES if partition is possible. Otherwise print NO in a separate line.
Sample Input
2
5
4 9 5 11 7
3
1 7 15
Sample Output
YES
NO
[School & College Level]
Inter School & College Programming Contest (ISCPC) 2017
Problem Setter: Md. Helal Uddin