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 double EPS = 1e-6;
const double INF = 2.0 * 1e-6;
const int MAXN = 200100;
int n;
double p[MAXN], p1[MAXN];
double myabs(double x) {
  if (x < 0.0) return -x;
  return x;
}
double check(double x) {
  memcpy(p1, p, sizeof p);
  for (int i = (0); i < int(n); i++) p1[i] -= x;
  double tmp = 0.0;
  double maks = 0.0;
  for (int i = (0); i < int(n); i++) {
    tmp += p1[i];
    if (tmp < 0.0) tmp = 0.0;
    maks = max(maks, tmp);
  }
  tmp = 0.0;
  for (int i = (0); i < int(n); i++) {
    tmp += p1[i];
    if (tmp > 0.0) tmp = 0.0;
    maks = max(maks, -tmp);
  };
  return maks;
}
int main() {
  scanf("%d", &n);
  for (int i = (0); i < int(n); i++) scanf("%lf", &p[i]);
  double lo = 0.0, hi = 1e7, mid;
  while (hi - lo > EPS) {
    mid = (lo + hi) / 2.0;
    if (check(mid) + EPS < check(mid + INF))
      hi = mid;
    else
      lo = mid;
  }
  double a = check(4.0), b = check(5.5);
  ;
  printf("%.9lf\n", check(lo));
  return 0;
}
