#P5726. 【深基4.习9】打分
【深基4.习9】打分
Problem Description
There are judges scoring a contestant, with scores ranging from to . You need to remove one highest score and one lowest score (if there are multiple highest or lowest scores, only remove one), and the average of the remaining scores is the contestant’s final score. Given the number of judges and their scores, output the contestant’s final score, accurate to decimal places.
Input Format
The first line contains a positive integer , indicating that there are judges.
The second line contains integers. The -th integer is the score given by the -th judge.
Output Format
Output one line with a number rounded to two decimal places, representing the contestant’s final score.
5
9 5 6 8 9
7.67
Hint
Constraints: the data guarantees that , and each judge’s score is an integer between and (inclusive of and ).
Translated by ChatGPT 5