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;
inline long long read() {
  long long x = 0;
  int v = 1, c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') v = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  return x * v;
}
const double eps = 1e-7;
const int MAXN = 200005;
const long double INF = 1e18;
int n;
long double a[MAXN];
void input() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
}
long double test(long double ans) {
  long double f, g, res;
  f = g = 0;
  res = -eps;
  for (int i = 1; i <= n; ++i) {
    long double p = a[i] - ans;
    f < 0 ? f += p : f = p;
    g > 0 ? g += p : g = p;
    res = max(res, max(-f, g));
  }
  return res;
}
void solve() {
  long double L = INF, R = 0;
  for (int i = 1; i <= n; ++i) {
    L = min(L, a[i]);
    R = max(R, a[i]);
  }
  while (R - L >= eps) {
    long double LM = L + (R - L) / 3, RM = R - (R - L) / 3;
    long double f1 = test(LM), f2 = test(RM);
    if (f1 < f2)
      R = RM;
    else
      L = LM;
  }
  printf("%.6f\n", (double)test((L + R) / 2));
}
int main() {
  input();
  solve();
  return 0;
}
