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 inf = 1e9;
const double eps = 1e-8;
vector<double> nab;
double n;
double prof(double value) {
  double mi = 0, cur = 0, sol = 0, ma = 0;
  for (double i = 0; i < n; i++) {
    cur += nab[i] - value;
    mi = min(mi, cur);
    ma = max(ma, cur);
    sol = max(cur - mi, sol);
    sol = max(fabs(cur - ma), sol);
  }
  return sol;
}
double tern(double l, double r) {
  while (fabs(r - l) > eps) {
    double t1 = 1.0 * (r - l) / 3 + l;
    double t2 = 2.0 * (r - l) / 3 + l;
    if (prof(t1) < prof(t2) - eps)
      r = t2;
    else
      l = t1;
  }
  return prof(r);
}
int main() {
  cin >> n;
  nab.resize(n);
  for (double i = 0; i < n; i++) cin >> nab[i];
  double sol = tern(-inf, inf);
  cout << fixed;
  cout << setprecision(7) << sol;
  return 0;
}
