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;
long a[200000], n;
double get_max(double x) {
  double res = 0, pred = 0, mn = 0, mx = 0;
  for (int i = 0; i < n; i++) {
    pred += a[i] - x;
    mn = min(mn, pred);
    res = max(res, pred - mn);
  }
  pred = 0, mn = 0;
  for (int i = 0; i < n; i++) {
    pred += a[i] - x;
    mn = max(mn, pred);
    mx = min(mx, pred - mn);
  }
  return max(res, -mx);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  double xl = -11000, xr = 11000;
  while (xr - xl > 1e-8) {
    double c = (xr - xl) / 3, ml = xl + c, mr = xr - c, a = get_max(ml),
           b = get_max(mr);
    if (a < b)
      xr = mr;
    else
      xl = ml;
  }
  cout << setprecision(15) << get_max(xr);
  return 0;
}
