10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#include <bits/stdc++.h>
using namespace std;
double n, a[200010], l, r;
inline double check(double x) {
  double sum = 0.0, ret = 0.0, minn = 0.0, maxx = 0.0;
  for (int i = 1; i <= n; i++) {
    sum += a[i] - x;
    ret = max(ret, fabs(sum - minn));
    ret = max(ret, fabs(sum - maxx));
    minn = min(minn, sum);
    maxx = max(maxx, sum);
  }
  return ret;
}
int main() {
  int cnt = 0;
  scanf("%lf", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
    l = min(l, -fabs(a[i]));
  }
  r = -l;
  while (cnt++ < 300) {
    double midl = 1.0 * (r - l) / 3.0 + 1.0, midr = 2.0 * (r - l) / 3.0 + 1.0;
    if (check(midl) < check(midr))
      r = midr;
    else
      l = midl;
  }
  printf("%.6lf", check(1.0 * (l + r) / 2.0));
}
