Problem4543--评委打分

4543: 评委打分

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

许多比赛在计算选手得分平均数的时候,都会先去掉一个最高得分,再去掉一个最低得分,这样可以避免极大值与极小值对平均值的影响。

给定 lns="http://www.w3.org/1998/Math/MathML">n 个数字 lns="http://www.w3.org/1998/Math/MathML">a1,a2,,an,表示一个选手获得的分数,请根据上述流程计算选手的最终得分。

注意如果有多个分数并列第一,则只会去掉一个最高分,去掉最低分的情况同理。

Input

第一行:单个整数 lns="http://www.w3.org/1998/Math/MathML">n
第二行:lns="http://www.w3.org/1998/Math/MathML">n 个整数表示 lns="http://www.w3.org/1998/Math/MathML">a1,a2,,an


  • 对 lns="http://www.w3.org/1998/Math/MathML">50% 的数据,lns="http://www.w3.org/1998/Math/MathML">3n1000
  • 对 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">3n100000
  • lns="http://www.w3.org/1998/Math/MathML">0ai20000

Output

一个浮点数:表示最终得分,四舍五入保留两位小数。

Sample Input Copy

5
100 1 20 30 40 

Sample Output Copy

30.00

HINT

(20+30+40)/3=30.00

Source/Category