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;
double arr[200001];
double minval(double x, int n) {
  double tarr[n];
  for (int i = 0; i < n; i++) tarr[i] = arr[i] - x;
  double maxarr[n];
  double minarr[n];
  maxarr[0] = tarr[0];
  minarr[0] = tarr[0];
  for (int i = 0; i < n; i++) {
    minarr[i] = min(tarr[i], minarr[i - 1] + tarr[i]);
    maxarr[i] = max(tarr[i], maxarr[i - 1] + tarr[i]);
  }
  double mini = 1000000000, maxi = -1000000000;
  for (int i = 0; i < n; i++) {
    mini = min(minarr[i], mini);
    maxi = max(maxarr[i], maxi);
  }
  return max(abs(maxi), abs(mini));
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  double maxi = -1000000, mini = 100000;
  for (int i = 0; i < n; i++) {
    maxi = max(maxi, arr[i]);
    mini = min(mini, arr[i]);
  }
  double xlo = mini, xhi = maxi;
  double ans1, ans2;
  while (xhi - xlo > 0.000001 / 200000.0) {
    double mid = (xhi + xlo) / 2.0;
    double mid1 = mid - 0.0000000000001;
    if (minval(mid, n) < minval(mid1, n))
      xlo = (xlo + xhi) / 2.0;
    else
      xhi = (xlo + xhi) / 2.0;
  }
  printf("%.6lf", minval(xhi, n));
}
