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