You are given a set of distinct integers. You need to separate them into two non-empty subsets such that each element belongs to exactly one of them and the sum of all elements of each subset is the same.
An anonymous tip told us that the problem above was unlikely to be solved in polynomial time (or something like that), so we decided to change it. Now you get to decide what half of the integers are!
This is an interactive problem with three phases. In phase 1, you choose N distinct integers. In phase 2, you are given another N integers that are distinct from each other and from the ones you chose in phase 1. In phase 3, you have to partition those 2N integers into two subsets, both of which sum to the same amount. All 2N integers are to be between 1 and 109, inclusive, and it is guaranteed that they sum up to an even number.
In the sample interaction above, the solution gets all cases right and would receive a correct verdict. Notice that the value for N does not conform to the limits for the Test Set and is used to simplify the example only. Notice that the judge could have given the solution the integers 2,7,100 for the first case, making it impossible for the solution to find a valid partition into subsets of equal sum.