// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define patkan 9
#define tisic 47
#define soclose 1e-9
#define pi 3.1415926535898
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define chocolate win
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):(x))
#define uint unsigned int
#include <time.h>
// mylittlepony
using namespace std;
int N;
vector<double> S;
bool check(double k) {
double Q =S[N]-N*k, m =S[1]-k;
for(int j =2; j < N; j++) {
if(Q-(S[j]-j*k)+m < soclose) return true;
m =min(m,S[j]-j*k);}
return false;}
int main() {
freopen("sabotage.in","r",stdin);
freopen("sabotage.out","w",stdout);
scanf(" %d",&N);
vector<int> A(N);
for(int i =0; i < N; i++) scanf(" %d",&A[i]);
S.resize(N+1,0);
for(int i =0; i < N; i++) S[i+1] =S[i]+A[i];
double ansA =0, ansB =1e+20;
while(ansB-ansA > soclose) {
double k =(ansB+ansA)/2;
if(check(k)) ansB =k;
else ansA =k;}
printf("%.3f\n",ansB);
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RhY2s+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxjbWF0aD4KI2luY2x1ZGUgPGlvbWFuaXA+CiNkZWZpbmUgZGlicyByZXNlcnZlCiNkZWZpbmUgT1ZFUjkwMDAgMTIzNDU2Nzg5MA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