#include <bits/stdc++.h>
using namespace std;
const long long inf = (1ll << 50);
const int mod = inf + 7;
const double pi = acos(-1.0);
const double eps = 1e-10;
double mi[220000], ma[220000], u[220000];
double second[220000];
int n, a[220000];
double first(double x) {
  for (int i = 1; i <= n; i++) second[i] = second[i - 1] + a[i] - x;
  mi[n] = second[n];
  ma[n] = second[n];
  for (int i = n - 1; i >= 1; i--) {
    ma[i] = max(ma[i + 1], second[i]);
    mi[i] = min(mi[i + 1], second[i]);
  }
  double res = 0, su = 0;
  for (int i = 1; i <= n; i++) {
    res = max(ma[i] + su, res);
    res = max(-(mi[i] + su), res);
    su += -a[i] + x;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  long long e = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    e += a[i];
  }
  double l = -(1e14);
  double r = (1e14);
  for (int i = 0; i <= 300; i++) {
    double m1 = l + (r - l) / 3.0;
    double m2 = r - (r - l) / 3.0;
    if (first(m1) < first(m2))
      r = m2;
    else
      l = m1;
  }
  printf("%.10lf", first(l));
  return 0;
}
