In the city, each of the schools was supposed to receive a computer lab with an equal number of computers. However, due to a mistake by the suppliers, the first school received a_1 computers, the second school received a_2, and so on, up to the -th school, which received a_N computers.
Your task is to determine the minimum number of computers that need to be moved between schools to achieve an equal distribution across all schools. If it's impossible to achieve equal distribution, output -1.
The first line contains the integer , representing the number of schools. The second line contains integers, which are the elements of the array , indicating the number of computers delivered to each school. Each value is a natural number and does not exceed .
Output the minimum number of computer transfers needed to achieve equal distribution, or -1 if equal distribution is not possible.
Example 1