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;
}
template <typename T>
inline void write(T x, int ch = 10) {
  static int s[20];
  register int t = 0;
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  do s[t++] = x % 10;
  while (x /= 10);
  while (t--) putchar('0' + s[t]);
  putchar(ch);
}
const double eps = 1e-7;
const int MAXN = 200005;
const double INF = 2e10;
int n;
long double a[MAXN], sum[MAXN];
void input() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
}
long double test(long double ans, int flag) {
  long double mins = INF, maxs = -INF;
  for (int i = 1; i <= n; ++i) {
    sum[i] = sum[i - 1] + flag * (a[i] - ans);
    mins = min(mins, sum[i]);
    maxs = max(maxs, sum[i]);
  }
  return abs(maxs - mins);
}
void solve() {
  long double L = INF, R = 0, ans;
  for (int i = 1; i <= n; ++i) {
    L = min(L, a[i]);
    R = max(R, a[i]);
  }
  ans = max(test(R, -1), test(R, 1));
  while (R - L >= eps) {
    long double M = L + (R - L) / 2;
    long double tmp = max(test(M, -1), test(M, 1));
    if (tmp < ans)
      ans = tmp, R = M;
    else
      L = M;
  }
  printf("%.6f\n", (double)ans);
}
int main() {
  input();
  solve();
  return 0;
}
