#include <bits/stdc++.h>
using namespace std;
int n, m, cnt;
double x[200010], inf = 1e9, eps = 1e-12;
double cal(double mi) {
  int i, s;
  double s1, s2, mx, mn;
  s1 = s2 = 0;
  mx = -inf;
  mn = inf;
  for (i = 1; i <= n; i++) {
    if (s1 + x[i] - mi < 0)
      s1 = 0;
    else
      s1 += x[i] - mi;
    if (s2 + x[i] - mi > 0)
      s2 = 0;
    else
      s2 += x[i] - mi;
    mx = max(mx, s1);
    mn = min(mn, s2);
  }
  return max(abs(mx), abs(mn));
}
int main() {
  int i, s, a, b, j, k;
  double l, r, m1, m2;
  while (cin >> n) {
    for (i = 1; i <= n; i++) scanf("%lf", &x[i]);
    l = -inf;
    r = inf;
    for (i = 0; i <= 600; i++) {
      m1 = (l + l + r) / 3.0;
      m2 = (l + r + r) / 3.0;
      if (cal(m1) < cal(m2))
        r = m2;
      else
        l = m1;
    }
    printf("%.10lf\n", cal(l));
  }
  return 0;
}
