The arithmetic mean of the array elements
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
The arithmetic mean of an array is calculated by dividing the sum of its elements by the number of elements. Determine the maximum number of elements that can be removed from the array while maintaining the same arithmetic mean for the remaining elements.
Input Data
The first line contains the integer N, representing the number of elements in the array, where 1 ≤ N ≤ 50. The second line contains N integers, each with an absolute value not exceeding 10,000.
Output Data
Output a single integer K, which is the maximum number of elements that can be removed from the array.
Example Explanation
For instance, you can remove the elements 1, 7, 7, 1 or 1, 2, 6, 7.
Examples
Input #1
Answer #1
Submissions 674
Acceptance rate 2%