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 pi = acos(-1.0);
const double eps = 1e-11;
double calc(vector<double> &v, double nm) {
  int n = int((v).size());
  double mx = 0;
  double cur = 0;
  for (int i = 0; i < n; i++) {
    if (cur < 0) {
      cur = 0;
    }
    cur += (v[i] - nm);
    mx = max(mx, cur);
  }
  cur = 0;
  for (int i = 0; i < n; i++) {
    if (cur > 0) {
      cur = 0;
    }
    cur += (v[i] - nm);
    mx = max(mx, abs(cur));
  }
  return mx;
}
int main() {
  std::ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<double> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  double l = -1000000000, r = 1000000000;
  for (int i = 0; i < 350; i++) {
    double m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (calc(v, m1) >= calc(v, m2)) {
      l = m1;
    } else
      r = m2;
  }
  cout << fixed;
  cout << setprecision(14);
  cout << min(calc(v, l), calc(v, r)) << endl;
  return 0;
}
