#include <bits/stdc++.h>
using namespace std;
const int SIZE = 2e5;
int a[SIZE], n;
double f(double x) {
  double ma = 0, mi = 0, now = 0;
  double res = 0;
  for (int i = 1; i <= n; i++) {
    now += a[i] - x;
    res = max(res, fabs(ma - now));
    res = max(res, fabs(mi - now));
    ma = max(ma, now);
    mi = min(mi, now);
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  double ll = -10000, rr = 10000;
  for (int k = 0; k < 100; k++) {
    double mm1 = ll * 0.54 + rr * 0.46;
    double mm2 = ll * 0.46 + rr * 0.54;
    double v1 = f(mm1);
    double v2 = f(mm2);
    if (v1 > v2)
      ll = mm1;
    else
      rr = mm2;
  }
  printf("%.15f\n", f((ll + rr) * 0.5));
  return 0;
}
