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;
double a[200010], sum, mx, mn;
int n, x;
char c;
bool b;
double f(double x) {
  sum = 0, mx = 0, mn = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i] - x;
    if (mx < sum) mx = sum;
    if (mn > sum) mn = sum;
  }
  return (mx - mn);
}
int qin() {
  b = false, x = 0;
  c = getchar();
  if (c == '-') {
    b = true;
    c = '0';
  }
  while (c != ' ') {
    x = x * 10 + (c - '0');
    c = getchar();
  }
  if (b) return -x;
  return x;
}
int qin2() {
  b = false, x = 0;
  c = getchar();
  if (c == '-') {
    b = true;
    c = '0';
  } else
    x = c - '0';
  while ((c = getchar()) != EOF && c >= '0' && c <= '9') x = x * 10 + (c - '0');
  if (b) return -x;
  return x;
}
int main() {
  n = qin2();
  for (int i = 0; i < n - 1; i++) a[i] = qin();
  a[n - 1] = qin2();
  double l = -10001, r = 10001, ml, mr, z1, z2;
  int x = 0;
  while (r - l >= 0.00000000001) {
    ml = (l + r) / 2.0;
    mr = (ml + r) / 2.0;
    z1 = f(mr), z2 = f(ml);
    if (z1 < z2)
      l = ml;
    else
      r = mr;
    x++;
  }
  l = (l + r) / 2.0;
  printf("%.15lf", f(l));
  return 0;
}
