Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/massiv-ortachadan-kattalar

Elements above the average

Easy 1000 ms 128 MB 23%
Share

A positive integer $n$ and an array of $n$ integers are given. Determine the number of elements whose value is strictly greater than the arithmetic mean of the array.

Counting the elements greater than the arithmetic mean of an array

Input

The first line contains a positive integer $n$. The second line contains $n$ integers separated by spaces.

Output

One integer — the number of elements greater than the arithmetic mean.

Note

$1 \le n \le 10^{4}$
$-1000 \le a_{i} \le 1000$

Examples

Input #1
5
1 2 3 4 10
Output #1
1
Input #2
3
5 5 5
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.