#include <bits/stdc++.h>
using namespace std;
int n, a[233333];
long double g = asin(1) / 5;
long double f(long double x) {
  long double cm = 0, maxm = -2000000001, minm = 2000000001;
  for (int i = 1; i <= n; i++) {
    long double A = a[i] + x;
    if (cm <= 0) cm = 0;
    cm += A;
    maxm = max(maxm, cm);
  }
  cm = 0;
  for (int i = 1; i <= n; i++) {
    long double A = a[i] + x;
    if (cm >= 0) cm = 0;
    cm += A;
    minm = min(minm, cm);
  }
  cm = 0;
  return max(max(maxm, -minm), cm);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  long double l = -20000.0, r = 20000.0;
  for (int i = 1; i <= 400; i++) {
    long double ml = r - l, m1 = l + ml * g, m2 = r - ml * g;
    long double x1 = f(m1), x2 = f(m2);
    if (x1 > x2)
      l = m1;
    else
      r = m2;
  }
  long double g = f(l);
  double ans = g;
  printf("%.6lf\n", ans);
}
