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>
int a[211111], n;
double mx, mn, P = 9876543, PP = P, PPP = P;
void f(double x) {
  mx = -987654321;
  mn = 987654321;
  double xx = 0, nn = 0;
  for (int i = 1; i <= n; i++) {
    xx += (a[i] - x);
    nn += (a[i] - x);
    if (xx < 0) xx = 0;
    if (nn > 0) nn = 0;
    if (xx > mx) mx = xx;
    if (nn < mn) mn = nn;
  }
}
int main() {
  scanf("%d", &n);
  int min_a = 987654321;
  int max_a = -987654321;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] < min_a) min_a = a[i];
    if (a[i] > max_a) max_a = a[i];
  }
  if (min_a == max_a) {
    printf("0.000000000000");
    return 0;
  }
  double l = min_a, r = max_a, mid;
  int t = 0;
  while (t == 0 && (r - l) > 0.00000000001) {
    mid = (l + r) / 2;
    f(mid);
    if (mx > -mn) {
      l = mid;
      if (P > mx) P = mx;
      PP = P;
      if (PPP - PP < 0.00000000001 && PP - PPP < 0.00000000001) t = 1;
      PPP = PP;
    } else {
      r = mid;
      if (P > -mn) P = -mn;
      PP = -P;
      if (PPP - PP < 0.000000001 && PP - PPP < 0.000000001) t = 1;
      PPP = PP;
    }
  }
  printf("%.012lf", P);
}
