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;
using db = long double;
using ll = long long;
using ull = unsigned long long;
using pII = pair<int, int>;
using pLL = pair<ll, ll>;
constexpr int mod = 1e9 + 7;
template <class T1, class T2>
inline void chadd(T1 &x, T2 y, int Mod = mod) {
  x += y;
  while (x >= Mod) x -= Mod;
  while (x < 0) x += Mod;
}
template <class T1, class T2>
inline void chmax(T1 &x, T2 y) {
  if (x < y) x = y;
}
template <class T1, class T2>
inline void chmin(T1 &x, T2 y) {
  if (x > y) x = y;
}
inline int nextInt() {
  int x;
  cin >> x;
  return x;
}
void rd() {}
template <class T, class... Ts>
void rd(T &arg, Ts &...args) {
  cin >> arg;
  rd(args...);
}
void err() {
  cout << "\033[39;0m"
       << "\n";
}
template <class T, class... Ts>
void err(const T &arg, const Ts &...args) {
  cout << arg << ' ';
  err(args...);
}
template <template <typename...> class T, typename t, typename... A>
void err(const T<t> &arg, const A &...args) {
  for (auto &v : arg) cout << v << ' ';
  err(args...);
}
void ptt() { cout << "\n"; }
template <class T, class... Ts>
void ptt(const T &arg, const Ts &...args) {
  cout << ' ' << arg;
  ptt(args...);
}
template <class T, class... Ts>
void pt(const T &arg, const Ts &...args) {
  cout << arg;
  ptt(args...);
}
void pt() {}
template <template <typename...> class T, typename t, typename... A>
void pt(const T<t> &arg, const A &...args) {
  for (int i = 0, sze = arg.size(); i < sze; ++i)
    cout << arg[i] << " \n"[i == sze - 1];
  pt(args...);
}
inline ll qpow(ll base, ll n) {
  assert(n >= 0);
  ll res = 1;
  while (n) {
    if (n & 1) res = res * base % mod;
    base = base * base % mod;
    n >>= 1;
  }
  return res;
}
constexpr int N = 2e5 + 10;
constexpr db eps = 1e-8L;
int n, a[N];
db S[N];
db gao(db x) {
  db res = 0;
  db Min = 0, Max = 0;
  for (int i = 1; i <= n; ++i) {
    S[i] = S[i - 1] + a[i] - x;
    chmax(res, fabs(S[i] - Min));
    chmax(res, fabs(S[i] - Max));
    chmax(Min, S[i]);
    chmin(Max, S[i]);
  }
  return res;
}
void run() {
  int ok = 1;
  for (int i = 1; i <= n; ++i) {
    rd(a[i]);
    if (i > 1 && a[i] != a[i - 1]) ok = 0;
  }
  if (ok) return pt(0.0);
  int cnt = 210;
  db l = -1e4, r = 1e4, res = 2e9;
  while (cnt--) {
    db a = l + (r - l) / 3;
    db b = l + (r - l) / 3 * 2;
    db L = gao(a), R = gao(b);
    if (L <= R) {
      chmin(res, L);
      r = b;
    } else {
      l = a;
    }
  }
  return pt(res);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(20);
  while (cin >> n) run();
  return 0;
}
