Logo
(追記) (追記ここまで)

25992번 - Adjusted Average 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 (추가 시간 없음) 1024 MB183393329.730%

문제

As a student of the Biology And Probability Course at your university, you have just performed an experiment as part of the practical assignments. However, your results do not look very nice: you had hoped that the average of your samples would be different from what it is now.

To improve your results, you decide to let some of your samples "magically disappear" (i.e., dump them in the waste bin). In order to not raise suspicion with your teacher, you can remove only a few of your samples. How close can you possibly get to your desired average?

입력

The input consists of:

  • One line with three integers $n,ドル $k,ドル and $\overline{x}$ (2ドル \leq n \leq 1500,ドル 1ドル \leq k \leq 4,ドル $k < n,ドル $\left| \overline{x} \right| \leq 10^9$), the number of samples, the number of samples that may be removed, and the average you think looks the nicest.
  • One line with $n$ integers $x$ ($\left| x \right| \leq 10^9$), representing the samples.

출력

Output the minimal absolute difference between $\overline{x}$ and the average you can obtain by removing at most $k$ samples from the dataset.

Your answer should have an absolute error of at most 10ドル^{-4}$.

제한

예제 입력 1

5 2 2
1 2 3 100 200

예제 출력 1

0

예제 입력 2

5 4 -5
-6 -3 0 6 3

예제 출력 2

0.5

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2022 A번

  • 문제를 만든 사람: Ludo Pulles
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /