#K676. Maximum Possible Average Score
Maximum Possible Average Score
Maximum Possible Average Score
You are given a list of non-negative integer scores provided as a single line of input with each score separated by spaces. You are allowed to remove at most one score to maximize the average of the remaining scores. If there is only one score, simply return that score. The average should be computed using integer (floor) division.
Formally, let (S = [s_1, s_2, \ldots, s_n]) be the list of scores with (n \ge 1). The goal is to maximize \
[ \text{average} = \left\lfloor \frac{\sum_{i=1}^{n} s_i - s_j}{n-1} \right\rfloor ]
where (s_j) is the score removed (if any removal is beneficial) and for (n=1) simply output (s_1).
inputFormat
A single line of input containing space-separated integers representing the scores.
outputFormat
Output a single integer which is the maximum possible average score after removing at most one score (if beneficial).## sample
50
50