#include <bits/stdc++.h>
using namespace std;
int n;
double v[200010];
double func(double x) {
  double mn = 0, mx = 0, a = 0, b = 0;
  for (int i = 0; i < n; i++) {
    a += v[i] - x;
    b += v[i] - x;
    mn = min(mn, a);
    mx = max(mx, b);
    if (a > 0) a = 0;
    if (b < 0) b = 0;
  }
  return max(mx, -mn);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &v[i]);
  double st, ed;
  st = -10000;
  ed = 10000;
  for (int i = 0; i < 100; i++) {
    double p1 = st + (ed - st) / 3.0;
    double p2 = ed - (ed - st) / 3.0;
    if (func(p1) >= func(p2))
      st = p1;
    else
      ed = p2;
  }
  printf("%.7lf\n", func(st));
  return 0;
}
