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;
double v[200010];
double func(double x) {
  double mn = 0, mx = 0, a = 0, b = 0;
  for (int i = 0; i < n; i++) {
    a += v[i] - x;
    b += v[i] - x;
    mn = min(mn, a);
    mx = max(mx, b);
    if (a > 0) a = 0;
    if (b < 0) b = 0;
  }
  return max(mx, -mn);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &v[i]);
  double st, ed;
  st = -10000;
  ed = 10000;
  for (int i = 0; i < 100; i++) {
    double p1 = st + (ed - st) / 3.0;
    double p2 = ed - (ed - st) / 3.0;
    if (func(p1) >= func(p2))
      st = p1;
    else
      ed = p2;
  }
  printf("%.7lf\n", func(st));
  return 0;
}
