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;
const int inf = 0x20202020;
const int mod = 1000000007;
const double eps = 1e-7;
const double pi = 3.1415926535897932384626;
int powmod(int a, int b) {
  int res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = (long long)res * a % mod;
    a = (long long)a * a % mod;
  }
  return res;
}
inline void rd(int &res) {
  char c;
  res = 0;
  while (c = getchar(), c < 48)
    ;
  do res = res * 10 + (c ^ 48);
  while (c = getchar(), c > 47);
}
inline void Max(double &a, double b) {
  if (a < b) a = b;
}
inline void Min(double &a, double b) {
  if (a > b) a = b;
}
inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
const int M = 200005;
int n, A[M];
double B[M];
double check(double x) {
  double res1 = 0, res2 = 0, tmp1 = 0, tmp2 = 0;
  for (int i = 1; i <= n; i++) B[i] = (double)A[i] - x;
  for (int i = 1; i <= n; i++) {
    tmp1 += B[i];
    tmp2 += B[i];
    Max(res1, tmp1);
    Min(res2, tmp2);
    if (tmp1 < 0) tmp1 = 0;
    if (tmp2 > 0) tmp2 = 0;
  }
  return max(res1, -res2);
}
int main() {
  int mn = inf, mx = -inf;
  rd(n);
  for (int i = 1; i <= n; i++) {
    rd(A[i]);
    mn = min(mn, A[i]);
    mx = max(mx, A[i]);
  }
  int cas = 100;
  double l = mn, r = mx;
  while (cas--) {
    double mid1 = l + (r - l) / 3, mid2 = l + (r - l) / 3 * 2;
    double res1 = check(mid1), res2 = check(mid2);
    if (res1 > res2)
      l = mid1;
    else
      r = mid2;
  }
  printf("%.8lf\n", check(l));
  return 0;
}
