1.Damage{DoldQuestion2}
Sabotage. PAS/C/CPP
[Problem description]
Paul, the top enemy of Farmer John, decided to destroy John's milking equipment. The milking equipment is arranged in a row with N (3 <= n <= 100000) milking machines, where the I-th milking machine produces m_ I Unit (1 <= m_ I <= 10,000) milk.
Paul plans to cut off a continuous milking machine from the I-th milking machine to the J-th milking machine (2 <= I <= j <= N-1 ). Note that he does not want to disconnect the first or last milking machine because it will make his plan too easy to find. Paul's goal is to minimize the average milk yield of other machines. Paul planned to remove at least one milking machine.
Calculate the minimum average milk yield for the remaining machines.
[File input]
The first behavior is two integers n.
Next line 2. n + 1, each line has an integer, indicating m_ I.
[File output]
The output is a row in total. An integer indicates the minimum average milk yield, which is rounded to three decimal places.
[Example 1]
5
5
1
7
8
2
[Output Example 1]
2.667
[Example]
Destroy 7 and 8, with 5, 1, and 2 left.
Usaco 2014 March gold P2 sabotage