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>
const double eps = 1e-10;
const int MaxN = 200005;
double a[MaxN];
int n;
double sol(double x) {
  double s = 0, mx = 0, mn = 0, res = -1e20;
  for (int i = 0; i < n; i++) {
    s += a[i] - x;
    res = std::max(res, fabs(s - mn));
    res = std::max(res, fabs(s - mx));
    mx = std::max(mx, s);
    mn = std::min(mn, s);
  }
  return res;
}
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) {
      scanf("%lf", &a[i]);
    }
    double l = -1e20, r = 1e20, mid1, mid2, res1, res2;
    for (int i = 0; i < 200; i++) {
      mid1 = (2 * l + r) / 3.0;
      mid2 = (l + 2 * r) / 3.0;
      res1 = sol(mid1);
      res2 = sol(mid2);
      if (res1 < res2 + eps) {
        r = mid2;
      } else {
        l = mid1;
      }
    }
    printf("%.12f\n", sol((l + r) / 2.0));
  }
  return 0;
}
