No.3216 Slightly Strong Fairies
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
Story
"I don't care if I have no name. It sounds more impressive that way, anyway."
Problem Statement
There are $N$ fairies at a lake. The strength of the $i(1\leq i\leq N)$-th fairy is $A_i$.
Let $L$ be the integer part of the average strength of the $N$ fairies, that is, $\displaystyle L=\left\lfloor \frac{1}{N}\sum_{i=1}^N A_i \right\rfloor$.
Find the number of fairies whose strength is at least $L+100$.
More formally, find the number of integers $i(1\leq i\leq N)$ satisfying the following.
- $A_i\geq L+100$
Input
$N$ $A_1\ A_2\ \cdots\ A_N$
- $1\leq N\leq 1000$
- $1\leq A_i\leq 1000$
- All inputs are integers.
Output
Let $n$ be the number of fairies satisfying the condition. Output it on $1$ line in the following format.
$n$
Print a newline at the end.
Sample
Sample 1
Input
3 200 400 300
Output
1
We have $L=300$. Thus, $A_1\lt 400, A_2\geq 400, A_3\lt 400$, so the answer is $1$.
Sample 2
Input
4 123 345 567 500
Output
2
Sample 3
Input
1 10
Output
0
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
nauclhlt