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;
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;
}
