#P7713. 「EZEC-10」打分
「EZEC-10」打分
Description
Little A goes to the Olympics.
There are judges in total, who give Little A scores .
Little A is not satisfied with his scores, so he increases the score given by one judge by . This is called one operation.
However, Little A cannot be too greedy: he can perform at most operations.
Little A's final score is the average of all scores after removing one highest score and one lowest score.
Little A wants to know the maximum possible final score.
Input Format
The first line contains two integers .
The second line contains integers .
Output Format
For easier output, Little A only needs to know what final score is.
3 2
1 2 3
3
4 3
1 2 2 3
6
Hint
[Sample 1 Explanation]
One feasible plan is: .
[Sample 2 Explanation]
One feasible plan is: .
[Constraints and Notes]
This problem uses bundled testdata.
- Subtask 1 (5 points): .
- Subtask 2 (10 points): .
- Subtask 3 (15 points): .
- Subtask 4 (70 points): no special restrictions.
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号