1823Mean of Subsequence

1823   Mean of Subsequence

题目描述

Given N numbers in a line, we can determine a continuous subsequence by giving its start position and its length.

PMH and Roy played a game the other day. Roy gives the start position first, then PMH gives the length. Roy wants the mean of the subsequence as large as possible, while PMH wants it as small as possible.

You are to calculate the best result Roy can get, assuming PMH is very clever.

输入格式:

There are multiple testcases.

Each testcase begins with a line containing N only.

The following line contains N numbers, separated by spaces.

输出格式:

For each testcase, you are to print the best mean of subsequece Roy can get, precise to 6 digit after decimal point.

输入样例 复制
10
2 10 4 6 5 10 10 2 3 2
输出样例 复制
5.777778

说明

29
95
通过提交
时空限制2000ms/64mb
题目来源
评测方式在线评测
题目类型基础强化
难        度