/*#include <bits/stdc++.h>
using namespace std;*/
/*1432 1243 1234 1324
14253 12534 12345
02112
1 6 2 7 3 8 4 9 5 10
2413 2134 1234
142536 125364 123645 123456
534621 534612 546123 561234*//*
int main()
{
int brr[200001], crr[200001];
vector<int> arr;
int n;
scanf("%d", &n);
for(int i=0;i<n;i++){
scanf("%d", &brr[i]);
arr.push_back(brr[i]);
}
sort(arr.begin(), arr.end());
for(int i=0;i<n;i++)
{
crr[arr[i]]=i+1;
}
int cnt=1;
for(int i=1;i<n;i++)
{
if(crr[brr[i]]!=crr[brr[i-1]]+1)
{
//printf("%d %d\n", crr[brr[i]], crr[brr[i-1]]+1);
cnt++;
}
}
if(cnt<=2)
printf("%d", cnt);
else
{
printf("3");
}
}*/
/*
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y)
{
if(y==0)
return x;
return gcd(y, x%y);
}
int main()
{
vector<pair<float, pair<int, int> > > arr;
int n;
scanf("%d", &n);
//printf("%d", gcd(8, 12));
for(int i=2;i<=n;i++)
{
for(int j=1;j<i;j++)
{
if(gcd(i, j)==1)
arr.push_back({(float)j/(float)i, {j, i}});
}
}
sort(arr.begin(), arr.end());
printf("0/1\n");
for(int i=0;i<arr.size();i++)
{
printf("%d/%d\n", arr[i].second.first, arr[i].second.second);
}
printf("1/1");
}*/
#include <bits/stdc++.h>
using namespace std;
vector<int> arr;
vector<int> segment;
int makesegment(int node, int start, int End)
{
if(start==End)
return segment[node]=arr[start];
int mid=(start+End)/2;
return segment[node]=makesegment(node*2, start, mid)+makesegment(node*2+1, mid+1, End);
}
int Sum(int node, int start, int End, int right, int left)
{
if(right<start||left>End)return 0;
if(right>=End&&left<=start)
return segment[node];
int mid=(start+End)/2;
int lsum=Sum(node*2, start, mid, right, left);
int rsum=Sum(node*2+1, mid+1, End, right, left);
return lsum+rsum;
}
int main()
{
int n;
scanf("%d", &n);
segment.resize(4*n+40);
arr.resize(n+10);
int total=0;
for(int i=0;i<n;i++)
{
scanf("%d", &arr[i]);
total+=arr[i];
}
float ans=987654321;
makesegment(1, 0, n-1);
//printf("%d ", segment[5]);
for(int i=1;i<n-1;i++)
{
for(int j=1;j<=i;j++)
{
int sum=Sum(1, 0, n-1, i, j);
int res=total-sum;
ans=min(ans, (float)res/(float)(n-i+j-1));
//printf("%d %f %d %d\n", sum, ans, i, j);
}
}
printf("%.3f", ans);
}