#include <bits/stdc++.h>
int n;
double a[200005];
double f(double x) {
  int i;
  double sum[200005] = {0}, max = 0, min = 0;
  for (i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[i - 1] - x;
    if (max < sum[i]) max = sum[i];
    if (min > sum[i]) min = sum[i];
  }
  return max - min;
}
int main() {
  int i;
  double l = -1e9, m, mm, r = 1e9;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%lf", &a[i]);
  for (i = 0; i < 200; i++) {
    m = l + (r - l) / 3;
    mm = r - (r - l) / 3;
    if (f(m) < f(mm))
      r = mm;
    else
      l = m;
  }
  printf("%.15f\n", f(l));
  return 0;
}
