#include <bits/stdc++.h>
using namespace std;
double a[200007];
int n;
double cal(double x) {
  double s, maxx, minn;
  maxx = a[0] - x;
  s = 0;
  for (int i = 0; i < n; i++) {
    if (s < 0)
      s = a[i] - x;
    else
      s = s + a[i] - x;
    if (s > maxx) maxx = s;
  }
  minn = a[0] - x;
  s = 0;
  for (int i = 0; i < n; i++) {
    if (s > 0)
      s = a[i] - x;
    else
      s = s + a[i] - x;
    if (s < minn) minn = s;
  }
  return max(fabs(maxx), fabs(minn));
}
int main() {
  while (scanf("%d", &n) == 1) {
    double L = 100000, R = -100000, mid, mmid, t1, t2, ans;
    for (int i = 0; i < n; i++) {
      scanf("%lf", a + i);
      L = min(a[i], L);
      R = max(a[i], R);
    }
    for (int i = 0; i < 200; i++) {
      mid = L + (R - L) / 3;
      mmid = R - (R - L) / 3;
      t1 = cal(mid);
      t2 = cal(mmid);
      if (t1 < t2)
        R = mmid, ans = t1;
      else
        L = mid, ans = t2;
    }
    printf("%.16f\n", ans);
  }
  return 0;
}
