10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int M = 4;
const int inf = 1e9 + 7;
const long long base = 1e18;
const double pi = acos(-1);
const double ep = 1e-9;
int n;
int a[N];
long long d[N];
int x[N];
int L[N], R[N];
int k = 0;
bool check(double ans) {
  double lo = -base, hi = base;
  for (int t = (int)1; t < (int)k + 1; t++) {
    double tmpL = (R[t] - ans) / x[t];
    double tmpR = (L[t] + ans) / x[t];
    if (tmpL > tmpR) return false;
    if (tmpL > hi) return false;
    if (tmpR < lo) return false;
    lo = max(lo, tmpL);
    hi = min(hi, tmpR);
  }
  return true;
}
int main() {
  cin >> n;
  for (int i = (int)1; i < (int)n + 1; i++) {
    scanf("%d", a + i);
    d[i] = d[i - 1] + a[i];
  }
  if (n <= 5000) {
    for (int len = 1; len <= n; len++) {
      long long mn = base, mx = -base;
      for (int i = 1; i + len - 1 <= n; i++) {
        mn = min(mn, d[i + len - 1] - d[i - 1]);
        mx = max(mx, d[i + len - 1] - d[i - 1]);
      }
      x[++k] = len;
      L[k] = mn;
      R[k] = mx;
    }
  } else {
    int sqr = sqrt(n);
    for (int len = 1; len <= n; len += sqr) {
      long long mn = base, mx = -base;
      for (int i = 1; i + len - 1 <= n; i++) {
        mn = min(mn, d[i + len - 1] - d[i - 1]);
        mx = max(mx, d[i + len - 1] - d[i - 1]);
      }
      x[++k] = len;
      L[k] = mn;
      R[k] = mx;
    }
    for (int len = 1; len <= sqr; len += 1) {
      long long mn = base, mx = -base;
      for (int i = 1; i + len - 1 <= n; i++) {
        mn = min(mn, d[i + len - 1] - d[i - 1]);
        mx = max(mx, d[i + len - 1] - d[i - 1]);
      }
      x[++k] = len;
      L[k] = mn;
      R[k] = mx;
    }
    for (int len = n; len >= max(1, n - sqr); len--) {
      long long mn = base, mx = -base;
      for (int i = 1; i + len - 1 <= n; i++) {
        mn = min(mn, d[i + len - 1] - d[i - 1]);
        mx = max(mx, d[i + len - 1] - d[i - 1]);
      }
      x[++k] = len;
      L[k] = mn;
      R[k] = mx;
    }
  }
  double lo = 0, hi = 2.0 * inf, g, res;
  while (lo <= hi) {
    g = (lo + hi) / 2;
    if (check(g)) {
      res = g;
      hi = g - ep;
    } else
      lo = g + ep;
  }
  printf("%.9lf", res);
}
