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