| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 22 | 14 | 13 | 72.222% |
Anissa has just finished her figure skating routine and is anxiously awaiting her scores. The way scoring works at this specific event is a little peculiar - each figure skater is evaluated by several judges and the scores are averaged to give a final score.
Jolie is managing the software used to compile the scores and notices that a hacker has gotten in and inserted many fake evaluations. She knows exactly how many scores she should expect, so she will manually invalidate evaluations until the number of evaluations matches the number of judges she knows actually submitted evaluations.
The problem is, Jolie doesn’t know which evaluation to invalidate. She decides to use the following metric for assessing the badness of a collection of scores after invalidating enough to get the number of evaluations to match the number of judges:
Compute the minimum badness over all possible collections of scores that can be obtained.
The first line of input contains two integers, $n$ and $k$ $(1 \le k < n \le 5 \cdot 10^5)$, where $n$ is the total number of evaluations and $k$ is the expected number of evaluations.
Each of the next $n$ lines contains a single integer $x$ $(1 \le x \le 10^6)$. These are the evaluations.
Output a single number, which is the minimum badness over all possible collections of scores that can be obtained. Answer is correct if it is within absolute or relative error of $10^{-6}$.
4 3 13 13 23 13
0
5 2 1 2 3 4 5
0.5
ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2025 F번
University > MIT > The MIT Programming Contest > 2025-26 > MIT Team Contest 1 F번