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>
int n;
double a[200005];
double f(double x) {
  int i;
  double b = 0, c = 0, d;
  for (i = 0; i < n; i++) {
    b += (a[i] - x);
    if (b < 0) b = 0;
    if (b >= c) c = b;
  }
  b = 0;
  for (i = 0; i < n; i++) {
    b += (x - a[i]);
    if (b < 0) b = 0;
    if (b >= c) c = b;
  }
  return c;
}
int main() {
  int i, j = 100;
  double m1, m2, v1, v2, l = -10000.0, r = 10000.0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%lf", &a[i]);
  while (j--) {
    m1 = l + (r - l) / 3.0;
    m2 = r - (r - l) / 3.0;
    v1 = f(m1);
    v2 = f(m2);
    if (v1 > v2)
      l = m1;
    else
      r = m2;
  }
  printf("%.7f00000000\n", f(l));
  return 0;
}
