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;
template <class T>
void rd(T& t) {
  char c;
  t = 0;
  int k = 1;
  while ((c = getchar()) < '-')
    ;
  if (c == '-') k = -1, (c = getchar());
  do t = t * 10 + (c ^ 48);
  while ((c = getchar()) > '/');
  t *= k;
}
template <class T>
void prinf(T t) {
  if (!t) return;
  prinf(t / 10);
  putchar(t % 10 ^ 48);
}
template <class T>
void ptn(T t) {
  if (!t) putchar('0');
  if (t < 0) putchar('-'), t = -t;
  prinf(t);
}
const int maxn = 2e5 + 5;
int n, a[maxn];
double mx, mi;
void solve(double x) {
  double sum = 0;
  for (int i = (1); i <= (n); i++) {
    sum += a[i] - x;
    mx = max(mx, sum);
    if (sum < 0) sum = 0;
  }
  sum = 0;
  for (int i = (1); i <= (n); i++) {
    sum += a[i] - x;
    mi = min(mi, sum);
    if (sum > 0) sum = 0;
  }
}
int main() {
  rd(n);
  for (int i = (1); i <= (n); i++) rd(a[i]);
  double l = -10001, r = 10001;
  for (int ii = (0); ii <= (100); ii++) {
    double mid = (l + r) / 2;
    mx = 0;
    mi = 0;
    solve(mid);
    if (mx > -mi)
      l = mid;
    else
      r = mid;
  }
  solve(l);
  printf("%lf", max(mx, -mi));
  return 0;
}
