#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = mod * mod;
const long double eps = 1e-6;
const long double pi = acos(-1.0);
int n;
vector<long double> a;
long double calc(long double x) {
  vector<long double> ra(n + 1);
  for (int i = 0; i < n; i++) {
    ra[i + 1] = ra[i] + a[i] - x;
  }
  long double ret = 0;
  long double mi = 0, ma = 0;
  for (int i = 1; i <= n; i++) {
    ret = max(ret, abs(ra[i] - mi));
    ret = max(ret, abs(ma - ra[i]));
    mi = min(mi, ra[i]);
    ma = max(ma, ra[i]);
  }
  return ret;
}
void solve() {
  cout << fixed << setprecision(7);
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long double le = -10000, ri = 10000;
  for (int aa = 0; aa < 100; aa++) {
    long double l = (le * 2 + ri) / 3.0;
    long double r = (le + 2 * ri) / 3.0;
    long double cl = calc(l), cr = calc(r);
    if (cl < cr)
      ri = r;
    else
      le = l;
  }
  cout << calc(le) << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
