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>
const int MAXN = 200000;
const int MINAi = -10000;
const int MAXAi = 10000;
double a[MAXN];
int main(void) {
  int n;
  int i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lf", &a[i]);
  }
  double maxPos, maxNeg;
  double curPos, curNeg;
  double l = MINAi, m, r = MAXAi;
  while (r - l > 1e-11) {
    m = (r + l) / 2;
    maxPos = 0.0;
    curPos = 0.0;
    for (i = 0; i < n; i++) {
      curPos += a[i] - m;
      if (curPos < 0.0) curPos = 0.0;
      if (maxPos < curPos) maxPos = curPos;
    }
    maxNeg = 0.0;
    curNeg = 0.0;
    for (i = 0; i < n; i++) {
      curNeg -= a[i] - m;
      if (curNeg < 0.0) curNeg = 0.0;
      if (maxNeg < curNeg) maxNeg = curNeg;
    }
    if (maxNeg > maxPos) {
      r = m;
    } else {
      l = m;
    }
  }
  printf("%.15lf\n", maxPos);
  return 0;
}
