#include <bits/stdc++.h>
using namespace std;
template <class C>
constexpr int sz(const C &c) {
  return int(c.size());
}
using ll = long long;
using ld = long double;
constexpr const char nl = '\n', sp = ' ';
template <class T, class F, class Cmp = less<T>>
T tsearch(T lo, T hi, F f, int iters, Cmp cmp = less<T>()) {
  for (int it = 0; it < iters; it++) {
    T m1 = lo + (hi - lo) / 3, m2 = hi - (hi - lo) / 3;
    if (cmp(f(m1), f(m2)))
      lo = m1;
    else
      hi = m2;
  }
  return lo + (hi - lo) / 2;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N;
  cin >> N;
  vector<ld> A(N);
  for (auto &&a : A) cin >> a;
  auto f = [&](ld x) {
    ld ret = 0, cur = 0;
    for (auto &&a : A) {
      cur += a - x;
      if (cur < 0) cur = 0;
      if (ret < cur) ret = cur;
    }
    cur = 0;
    for (auto &&a : A) {
      cur -= a - x;
      if (cur < 0) cur = 0;
      if (ret < cur) ret = cur;
    }
    return ret;
  };
  cout << fixed << setprecision(9)
       << f(tsearch(ld(-3e4), ld(3e4), f, 300, greater<ld>())) << nl;
  return 0;
}
