#include <bits/stdc++.h>
int arr[200000];
int main() {
  int n;
  double lp = -10000;
  double rp = 10000;
  double med, a, b, c, d;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
  }
  while (rp - lp > 1e-12) {
    med = (lp + rp) / 2;
    a = -10001;
    b = 10001;
    c = d = 0;
    for (int i = 0; i < n; ++i) {
      c += arr[i] - med;
      if (c < 0) c = 0;
      if (c > a) a = c;
      d += arr[i] - med;
      if (d > 0) d = 0;
      if (d < b) b = d;
    }
    if (a + b > 0) {
      lp = med;
    } else {
      rp = med;
    }
  }
  printf("%.9f\n", a);
}
