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 T>
inline void Read(T &x) {
  int f = 1;
  char t = getchar();
  while (t < '0' || t > '9') {
    if (t == '-') f = -1;
    t = getchar();
  }
  x = 0;
  while (t >= '0' && t <= '9') {
    x = x * 10 + t - '0';
    t = getchar();
  }
  x *= f;
}
const int maxn = 200005;
int n, a[maxn], ll = maxn, rr = -maxn;
double e[maxn];
void input() {
  Read(n);
  for (register int i = 1; i <= n; i++)
    Read(a[i]), ll = min(ll, a[i]), rr = max(rr, a[i]);
}
double calc(double del) {
  double now_max = 0, now_min = 0, cn1 = 0, cn2 = 0;
  for (register int i = 1; i <= n; i++) e[i] = a[i] - del;
  for (register int i = 1; i <= n; i++) {
    cn1 += e[i], cn2 += e[i];
    now_max = max(now_max, cn1);
    now_min = min(now_min, cn2);
    if (cn1 < 0) cn1 = 0;
    if (cn2 > 0) cn2 = 0;
  }
  return max(now_max, -now_min);
}
void solve() {
  double l = -20000, r = 20000, lmid, rmid, re1, re2;
  while (r - l > 1e-7) {
    lmid = l + (r - l) / 3;
    rmid = lmid + (r - l) / 3;
    re1 = calc(lmid), re2 = calc(rmid);
    if (re1 < re2)
      r = rmid;
    else
      l = lmid;
  }
  printf("%.15f\n", (double)calc((r + l) / 2));
}
int main() {
  input();
  solve();
  return 0;
}
