#include <bits/stdc++.h>
using namespace std;
int n;
vector<long double> cum, cumt;
long double weakness() {
  long double mx = 0, mxc = 0, mn = INT_MAX, mnc = INT_MAX;
  mx = mxc = cum[0];
  for (int i = 1; i < n; i++) {
    mxc = max(cum[i], mxc + cum[i]);
    mx = max(mx, mxc);
  }
  mn = mnc = cum[0];
  for (int i = 1; i < n; i++) {
    mnc = min(cum[i], mnc + cum[i]);
    mn = min(mn, mnc);
  }
  return max(abs(mx), abs(mn));
}
long double calc(long double x) {
  for (double i = 0; i < n; i++) cum[i] = cumt[i] - x;
  return weakness();
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  cum.resize(n), cumt.resize(n);
  for (int i = 0; i < n; i++) cin >> cum[i];
  cumt = cum;
  long double a = -10000, d = 10000, b = (2 * a + d) / 3, c = (a + 2 * d) / 3;
  while (c - b > 0.000000000001) {
    if (calc(b) > calc(c))
      a = b;
    else
      d = c;
    b = (2 * a + d) / 3, c = (a + 2 * d) / 3;
  }
  cout << fixed << setprecision(7) << calc(b) << endl;
  cin.ignore(), cin.get();
}
