#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#include<queue>
#include<list>
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
#define mmt(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define mp make_pair
#define y1 fuck
#define N 300010
using namespace std;
typedef long long LL;
typedef long double LD;
double a[N],b[N],sum[N],Max[N];
int n;
bool check(double x)
{
  int i;
  FOR(i,1,2*n) b[i]=a[i]-x;
  sum[0]=0;
  FOR(i,1,2*n) sum[i]=sum[i-1]+b[i];
  Max[n-1]=sum[n-1];
  ROF(i,n-2,1)
  {
    Max[i]=max(Max[i+1],sum[i]);
  }
  FOR(i,n+1,2*n-2)
  {
    int p=i-n+1;
    //if (p==n) continue;
    if (sum[i]-Max[p]<0) return 1;
  }
  return 0;
}
int main()
{
  scanf("%d",&n);int i;double ans;
  FOR(i,1,n) scanf("%lf",&a[i]);
  FOR(i,1,n) a[n+i]=a[i];
  double L=0,R=1e9;
  while (1)
  {
    if (R-L<=1e-5){ans=L;break;}
    double mid=(L+R)/2;
    if (check(mid)) R=mid;else L=mid;
  }
  //printf("%d\n",check(2));
  printf("%.3lf\n",ans);
  return 0;
}