#P1254. Simple学长的礼物
Simple学长的礼物
Problem Description
The Christmas Eve is coming,so simple has bought n apples for his two friends. Now he wants to divide all the apples between the friends. Each apple weights 100 grams or 200 grams.Of course Simple doesn't want to make any of his friend unhappy. Therefore the total weight of the apples given to his friends must be equal. But unfortunately Simple doesn't have a knife,so he cannot split any apple into some parts. Please, tell him: is it possible to divide all the apples in a fair way between his friends?Input Format
The first T indicates there are T groups of date.
The first line of every group contains an integer n (1 <= n <= 100) — the number of apples. The second line contains n integers w1, w2, ..., wn (wi = 100or wi = 200), where wi is the weight of the i-th apple.
Output Format
In a single line print "YES" (without the quotes) if it is possible to divide all the apples between his friends. Otherwise print "NO" (without the quotes).2
3
100 200 100
4
100 100 100 200YES
NO
Source
2016周赛 八相关
在下列比赛中: