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