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;
int arr[200005];
long double f(long double x) {
  long double csum = 0.0;
  long double dsum = 0.0;
  long double mxsum = 0.0;
  long double mnsum = 0.0;
  for (int i = 1; i <= n; i++) {
    csum += (long double)arr[i] - x;
    dsum += (long double)arr[i] - x;
    if (csum < 0.0) csum = 0.0;
    if (dsum > 0.0) dsum = 0.0;
    mxsum = max(mxsum, csum);
    mnsum = min(mnsum, dsum);
  }
  return max(mxsum, -mnsum);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", arr + i);
  }
  long double lo = -200000;
  long double hi = 200000;
  long double l, r;
  while (hi - lo > 1e-11) {
    l = (2.0 * lo + hi) / 3.0;
    r = (lo + 2.0 * hi) / 3.0;
    if (f(l) <= f(r)) {
      hi = r;
    } else {
      lo = l + 1e-11;
    }
  }
  printf("%.10Lf", f(lo));
  return 0;
}
