#include <bits/stdc++.h>
using namespace std;
long double a[200100], b[200100];
int n;
long double tru(long double x) {
  int k;
  long double max = 0, pos = 0, neg = 0;
  for (k = 1; k <= n; k++) {
    b[k] = a[k] + x;
  }
  for (k = 1; k <= n; k++) {
    pos += b[k];
    neg += b[k];
    if (fabs(pos) > max) max = fabs(pos);
    if (fabs(neg) > max) max = fabs(neg);
    if (pos < 0) pos = 0;
    if (neg > 0) neg = 0;
  }
  return max;
}
int main() {
  int k;
  cin >> n;
  long double d = 1e-12, l = -123034, r = 171022, p, q, m;
  for (k = 1; k <= n; k++) cin >> a[k];
  for (k = 1; k <= 100; k++) {
    m = (l + r) / 2;
    p = tru(m);
    q = tru(m + d);
    if (p > q)
      l = m;
    else
      r = m;
  }
  cout << setprecision(12) << tru(m);
}
