Equal Sum
시간 제한5초메모리 제한1024 MB
먼저 서로 다른 정수 N개를 고르고, 심판이 준 N개를 받은 뒤 2N개의 수를 합이 같은 두 집합으로 나눈다.
문제
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 distinct integers. In phase 2, you are given another integers that are distinct from each other and from the ones you chose in phase 1. In phase 3, you have to partition those integers into two subsets, both of which sum to the same amount. All integers are to be between and , 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 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 for the first case, making it impossible for the solution to find a valid partition into subsets of equal sum.