#P8830. [传智杯 #3 练习赛] 评委打分

[传智杯 #3 练习赛] 评委打分

Problem Description

Xiao A participates in a variety show. There are n(3n106)n(3 \le n \le 10^6) judges scoring (scores are integers from 0 to 100), and each judge reveals their score in order.

For show effect, starting from the third judge, every time the ii-th judge gives a score, immediately calculate the contestant's average score among the first ii judges' scores after removing one highest score and one lowest score. Take the average of the remaining i2i-2 judges' scores and keep 22 decimal places.

Input Format

The first line contains an integer nn, indicating the number of judges.

The second line contains nn integers, indicating the scores given by the judges.

Output Format

Output a total of n2n-2 lines, each line representing the corresponding answer.

6
11 45 14 19 19 81
14.00
16.50
17.33
24.25

Hint

Translated by ChatGPT 5