#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, y, T, ans, big, cas, num, len;
bool flag;
double a[200005];
double chk(double x) {
  double pre, pre2, ans, ans2;
  ans = 0;
  ans2 = 0;
  pre = 0;
  pre2 = 0;
  for (int i = 1; i <= n; i++) {
    pre += a[i] - x;
    ans = max(ans, fabs(pre));
    pre = max(pre, 0.0);
    pre2 += a[i] - x;
    ans2 = max(ans2, fabs(pre2));
    pre2 = min(pre2, 0.0);
  }
  return max(fabs(ans), fabs(ans2));
}
int main() {
  scanf("%d", &n);
  double mx = -0x3fffffff, mi = 0x3fffffff;
  for (i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
    mx = max(mx, a[i]);
    mi = min(mi, a[i]);
  }
  double l = mi, r = mx;
  for (int i = 1; i <= 100; i++) {
    double m1 = (r + 2 * l) / 3;
    double m2 = (2 * r + l) / 3;
    if (chk(m1) < chk(m2))
      r = m2;
    else
      l = m1;
  }
  printf("%.12lf\n", chk(l));
  return 0;
}
