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;
int read() {
  char c;
  int s = 0, t = 1;
  while (!isdigit(c = getchar()))
    if (c == '-') t = -1;
  do {
    s = s * 10 + c - '0';
  } while (isdigit(c = getchar()));
  return s * t;
}
int ab(int x) { return x > 0 ? x : -x; }
const int maxn = 200010;
const double eps = 1e-11;
int n;
double a[maxn], b[maxn];
int t;
double F(double x) {
  for (int i = 1; i <= n; i++) b[i] = a[i] - x;
  double sum = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    sum += b[i];
    if (sum < 0) sum = 0;
    ans = max(ans, sum);
  }
  sum = 0;
  double ans0 = 0;
  for (int i = 1; i <= n; i++) {
    sum += b[i];
    if (sum > 0) sum = 0;
    ans0 = max(ans0, -sum);
  }
  return max(ans, ans0);
}
int main() {
  n = read();
  double m1, m2, l = -10010, r = 10010;
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  while (r - l > eps) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    if (F(m1) < F(m2))
      r = m2;
    else
      l = m1;
  }
  printf("%.10lf", F(l));
  return 0;
}
