#include <bits/stdc++.h>
using namespace std;
int n;
long double a[200005], b[200005];
long double fun(long double x) {
  for (int i = 0; i < n; i++) {
    b[i] = a[i] - x;
  }
  long double msum = b[0];
  long double ans = b[0];
  int i;
  for (i = 1; i < n; i++) {
    msum = max(b[i], msum + b[i]);
    ans = max(ans, msum);
  }
  long double msum1 = b[0];
  long double ans1 = b[0];
  for (i = 1; i < n; i++) {
    msum1 = min(msum1 + b[i], b[i]);
    ans1 = min(ans1, msum1);
  }
  return max(abs(ans), abs(ans1));
}
int main() {
  cin >> n;
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long double lo = -2000000200, hi = 2000000200;
  long double m1, m2, ans;
  long double eps = 1e-13;
  while (hi - lo > eps) {
    m1 = lo + (hi - lo) / 3;
    m2 = hi - (hi - lo) / 3;
    long double val1 = fun(m1);
    long double val2 = fun(m2);
    if (val1 < val2) {
      hi = m2;
    } else {
      lo = m1;
    }
  }
  ans = fun(lo);
  cout << fixed << setprecision(10) << ans;
  return 0;
}
