#d2914. 一半相等
一半相等
Half Equal
Problem Description
You are given an array of integers ( is even).
Consider such a . In one operation you choose an index and decrease by . After performing several operations (possibly ), at least half of the elements in the array become equal. Find the largest such ; if can be arbitrarily large, output .
Input Format
The input consists of two lines. The first line is a positive integer , the size of the array. The second line contains integers .
Output Format
Output the described in the problem statement.
Sample Input
8
-1 0 1 -1 0 1 -1 0
Sample Output
2
Constraints
, it is guaranteed that is even.
.