포럼
문제 ICPC00339

A. Adjusted Average

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

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
출력
0
예제 2
입력
5 4 -5
-6 -3 0 6 3
출력
0.5
예제 3
입력
4 1 4
1 3 3 7
출력
0.333333333333333
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC BAPC 2022

평가 및 의견

A. Adjusted Average

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

A. Adjusted Average

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8