Equal Sum

아직 제출이 없습니다시간 제한5초메모리 제한1024 MB

문제

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\mathbf{N} distinct integers. In phase 2, you are given another N\mathbf{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 2N2\mathbf{N} integers into two subsets, both of which sum to the same amount. All 2N2\mathbf{N} integers are to be between 11 and 10910^9, 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\mathbf{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\\{2, 7, 100\\} for the first case, making it impossible for the solution to find a valid partition into subsets of equal sum.