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;
int n;
double a[1000000];
double f(double x) {
  double mn = 0, mx = 0, sm = 0, ret = 0;
  for (int i = 0; i < n; i++) {
    sm += a[i] - x;
    if (sm < 0) {
      ret = max(ret, fabs(sm - mx));
    } else
      ret = max(ret, fabs(sm - mn));
    mn = min(mn, sm);
    mx = max(mx, sm);
  }
  return ret;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  double l = -1e5, r = 1e5;
  for (int i = 0; i < 300; i++) {
    double g = (r - l) / 3 + l;
    double h = 2 * (r - l) / 3 + l;
    if (f(g) < f(h)) {
      r = h;
    } else {
      l = g;
    }
  }
  cout << fixed << setprecision(10) << f(l) << endl;
}
