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>
const int N = 200002;
const double eps = 1e-7;
int n, i, a[N];
double l, r, lm, rm, u, v, b[N], s[N];
double fabs(double x) { return x > 0 ? x : -x; }
double max(double x, double y) { return x > y ? x : y; }
double f(double x) {
  for (i = 1; i <= n; i++) b[i] = a[i] - x, s[i] = s[i - 1] + b[i];
  double Max = 0, Min = 0, ans = 0;
  for (i = 1; i <= n; i++) {
    ans = max(max(Max - s[i], s[i] - Min), ans);
    if (s[i] > Max) Max = s[i];
    if (s[i] < Min) Min = s[i];
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", a + i);
  l = -10000;
  r = 10000;
  while (1) {
    lm = (l * 2 + r) / 3;
    rm = (l + r * 2) / 3;
    u = f(lm);
    v = f(rm);
    if (fabs(u - v) < eps && r - l < eps) break;
    if (u < v)
      r = rm;
    else
      l = lm;
  }
  printf("%.10lf", u < v ? u : v);
}
