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>
int n;
double k[200005];
double deal(double);
int main() {
  double L = -100000000, R = 100000000, mL = L + (R - L) / 3,
         mR = R - (R - L) / 3, r1, r2;
  scanf("%d", &n);
  for (int i = 1; i != n + 1; ++i) {
    scanf("%lf", &k[i]);
  }
  while (R - L >= 0.00000000001) {
    r1 = deal(mL);
    r2 = deal(mR);
    if (r1 < r2)
      R = mR;
    else
      L = mL;
    mL = L + (R - L) / 3;
    mR = R - (R - L) / 3;
  }
  printf("%.9f", deal(L));
  return 0;
}
double deal(double x) {
  double usum = k[1] - x, upsum = k[1] - x, dsum = (k[1] - x),
         dpsum = (k[1] - x);
  for (int i = 2; i < n + 1; ++i) {
    if (upsum > 0)
      upsum += k[i] - x;
    else
      upsum = k[i] - x;
    if (upsum > usum) usum = upsum;
    if (dpsum < 0)
      dpsum += k[i] - x;
    else
      dpsum = k[i] - x;
    if (dpsum < dsum) dsum = dpsum;
  }
  if (usum < 0) usum = -usum;
  if (dsum < 0) dsum = -dsum;
  return (usum > dsum) ? usum : dsum;
}
