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, m, o, re = 0;
double res = 0;
int a[1000010], b[1000010];
bool chk[1000010];
double calc(double d) {
  double ss = 0, sm = 0, ss2 = 0;
  for (int j = 0; j < n; j++) {
    if (ss < 0) ss = 0;
    if (ss2 > 0) ss2 = 0;
    ss += (double)a[j] - d;
    ss2 += (double)a[j] - d;
    sm = max(sm, max(((ss) < 0 ? -(ss) : (ss)), ((ss2) < 0 ? -(ss2) : (ss2))));
  }
  return sm;
}
int main() {
  int i, j, k, l;
  double ll = 0, rr = 2147483647, mid;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < 100; i++) {
    mid = (ll + rr) / 2;
    res = calc(mid);
    double res2 = calc(mid + 1e-7);
    if (res < res2)
      rr = mid;
    else
      ll = mid;
  }
  printf("%.7lf", calc(ll));
  return 0;
}
