BubbleProperHalf
You are given n integer numbers, where n+1 is a power of 2. You should select any m=n+1/2 of those n numbers, such that their sum is divisible by m.
InputFirst line contains an integer n, the number of given integers, with 1 ≤ n ≤ 50000. In the next line there are n integers ak separated by a space, k = 1, 2,...n, |ak| ≤ 10<sup>8</sup>.
OutputA sequence of n characters, each being ‘+’ or ‘-‘. If the k<sup>th</sup> character is ‘+’, that means the k<sup>th</sup> number in the input sequence is selected into the sum, and ‘-‘ that it is not.
Input:
Output:
7
1 -4 3 7 6 -2 5Output:
---++++Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.