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 ZERO = 1e-10;
int a[200009];
int n;
double ans;
double sum(double x) {
  double mmax = 0;
  double mmin = 0;
  double ret = 0;
  double tmp = 0;
  for (int i = 1; i <= n; i++) {
    tmp = tmp + a[i] - x;
    ret = max(ret, fabs(tmp - mmax));
    ret = max(ret, fabs(tmp - mmin));
    mmax = max(mmax, tmp);
    mmin = min(mmin, tmp);
  }
  return ret;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  double l = -1e9;
  double r = 1e9;
  while (r - l > 1e-11) {
    double ml = (l + r) / 2;
    double mr = (ml + r) / 2;
    if (sum(ml) > sum(mr))
      l = ml;
    else
      r = mr;
  }
  ans = sum(r);
  printf("%.10f\n", ans);
  return 0;
}
