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