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;
const int SIZE = 2e5;
int a[SIZE], n;
double f(double x) {
  double ma = 0, mi = 0, now = 0;
  double res = 0;
  for (int i = 1; i <= n; i++) {
    now += a[i] - x;
    res = max(res, fabs(ma - now));
    res = max(res, fabs(mi - now));
    ma = max(ma, now);
    mi = min(mi, now);
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  double ll = -10000, rr = 10000;
  for (int k = 0; k < 100; k++) {
    double mm1 = ll * 0.54 + rr * 0.46;
    double mm2 = ll * 0.46 + rr * 0.54;
    double v1 = f(mm1);
    double v2 = f(mm2);
    if (v1 > v2)
      ll = mm1;
    else
      rr = mm2;
  }
  printf("%.15f\n", f((ll + rr) * 0.5));
  return 0;
}
