You are given an array having n elements. In one operation, you can make a[i]=a[i]∗(−1), that is, you can change a positive number into a negative number and vice versa. You can use this operations for several times.
Your task is to print the minimum number of operations that are required to make the sum of elements of array zero.
Input format
Output format
In a new line, print the minimum number of operations that required to make the sum of elements zero. Otherwise, print −1 if you cannot make the sum of elements in array zero after applying many operations.
Note: The absoulte value of the sum of the elements of the array in input is not more than 103.
Explanation : First Test Case : 2 operations required on elements 2 & 6. New array becomes = [-6,1,4,3,-2]. And the total sum = 0.
Second Test Case :
If operation is performed on 3 , new array becomes = [2,1,-3]. And total sum = 0. Thus, only 1 operation is required.