#include <bits/stdc++.h>
using namespace std;
double mcs(int n, double a[200005]) {
  double mx = 0, now = 0;
  for (int i = 0; i < n; i++) {
    now += a[i];
    if (now > mx) mx = now;
    if (now < 0) now = 0;
  }
  return mx;
}
int n, a[200005];
double b[200005];
void calc(double m, double& vp, double& vn) {
  for (int i = 0; i < n; i++) b[i] = a[i] - m;
  vp = mcs(n, b);
  for (int i = 0; i < n; i++) b[i] = -1 * b[i];
  vn = mcs(n, b);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  double L = *min_element(a, a + n);
  double R = *max_element(a, a + n);
  for (int i = 0; i < 100; i++) {
    double m = (L + R) / 2;
    double vp, vn;
    calc(m, vp, vn);
    if (vp > vn)
      L = m;
    else
      R = m;
  }
  double m = (L + R) / 2;
  double vp, vn;
  calc(m, vp, vn);
  printf("%.7lf\n", max(vp, vn));
  return 0;
}
