Mercari OA

Example:

Input:
6
5
3
2
4
1
2

Output:
4
5

If subset A is [4,5], the sum of values, 9, is greater than the sum of the rest of the values.