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 maxn = 200005;
const double inf = 0x3f3f3f3f;
int n;
double a[maxn], mmin, mmax, tmin, tmax;
double weakness(double pos) {
  mmin = 0;
  mmax = 0;
  tmin = 0;
  tmax = 0;
  for (int i = 0; i < n; i++) {
    tmin += a[i] - pos;
    if (tmin > 0) tmin = 0;
    tmax += a[i] - pos;
    if (tmax < 0) tmax = 0;
    mmin = min(mmin, tmin);
    mmax = max(mmax, tmax);
  }
  return max(-mmin, mmax);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  int cnt = 0;
  double left = -10000, right = 10000;
  while (cnt++ < 300) {
    double mid = (left + right) / 2;
    double mmid = (mid + right) / 2;
    if (weakness(mid) < weakness(mmid))
      right = mmid;
    else
      left = mid;
  }
  printf("%.9lf\n", weakness(left));
  return 0;
}
