#P5726. 【深基4.习9】打分

【深基4.习9】打分

Problem Description

There are n(n1000)n(n \le 1000) judges scoring a contestant, with scores ranging from 00 to 1010. 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 22 decimal places.

Input Format

The first line contains a positive integer nn, indicating that there are nn judges.

The second line contains nn integers. The ii-th integer is the score given by the ii-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 3n10003 \leq n \leq 1000, and each judge’s score is an integer between 00 and 1010 (inclusive of 00 and 1010).

Translated by ChatGPT 5