#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;
}
