Squary
메모리 제한1024 MB
정수 목록이 주어질 때, 1개 이상 K개 이하의 정수를 더해 합의 제곱이 제곱의 합과 같아지도록 만들 수 있는지 판별하고 그 목록을 출력한다.
문제
Addition and squaring do not commute. That is, the square of the sum of all elements of a list of integers is not necessarily equal to the sum of the squares of those same elements. However, this is true for some lists; one example is , because . Let us call these lists squary.

Given a (not necessarily squary) list of relatively small integers, we want to know whether it is possible to add at least and at most more elements such that the final list is squary. Each added element must be an integer between and , inclusive, and these do not have to be distinct from each other or from the initial list's elements.
입력
The first line of the input gives the number of test cases, . test cases follow. Each test case is described in two lines. The first line contains two integers and , the number of elements of the initial list and the maximum number of elements you may add, respectively. The second line contains integers , representing the elements of the initial list.
출력
For each test case, output one line containing Case #x: y, where is the test case number (starting from 1). If it is possible to add at least and at most elements (each an integer between and , inclusive) to the initial list such that the square of the sum of its elements equals the sum of the squares of its elements, should be , where and the values are the additional elements. If there is no way to accomplish this, should be IMPOSSIBLE.
제한
- .
- .
- , for all .