1910 : Radical and array

时间限制:1 Sec 内存限制:128 MiB
提交:61 答案正确:40

提交 状态 讨论区

题目描述

Radical has an array , he wants the array to have as many equal numbers as possible.

He can performs the following operation as many times as he wants:

1.he chooses two elements of the array a[i] , a[j] (i!=j).

2.he simultaneously increases number a[i] by 1 and decreases number a[j] by 1

Now he want to know what maximum number of equal array elements he can get if he performs an arbitary number of such operation.

输入

The first line contains integer n (1 ≤ n ≤ 105) — the array size. The second line contains space-separated integers a1, a2, ..., an (ai ≤ 100000) — the original array.

输出

Print a single integer — the maximum number of equal array elements Radical can get if he performs an arbitrary number of the given operation.

样例输入

复制
2
2 3
3
2 4 3

样例输出

复制
1
3

提示


			

来源

NBUT