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 n;
int a[200000 + 10], ans = -0x7fffffff;
double l[200000 + 10];
void Read(int &x) {
  char c;
  bool f = 0;
  while (c = getchar(), c != EOF) {
    if (c == '-') f = 1;
    if (c >= '0' && c <= '9') {
      x = c - '0';
      while (c = getchar(), c >= '0' && c <= '9') x = x * 10 + c - '0';
      if (f) x = -x;
      ungetc(c, stdin);
      return;
    }
  }
}
double get_poor(double x) {
  int i;
  double sum = 0, ret = 0;
  for (i = 1; i <= n; i++) l[i] = a[i] - x;
  for (i = 1; i <= n; i++) {
    sum += l[i];
    if (sum < 0) sum = 0;
    ret = max(sum, ret);
    l[i] = -l[i];
  }
  sum = 0;
  for (i = 1; i <= n; i++) {
    sum += l[i];
    if (sum < 0) sum = 0;
    ret = max(sum, ret);
  }
  return ret;
}
int main() {
  Read(n);
  int i;
  for (i = 1; i <= n; i++) Read(a[i]);
  double l = -1e4, r = 1e4, m1, m2, v1, v2;
  i = 100;
  while (i--) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    v1 = get_poor(m1);
    v2 = get_poor(m2);
    if (v1 > v2)
      l = m1;
    else
      r = m2;
  }
  printf("%.15lf\n", get_poor(l));
}
