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;
const double EPS = 1e-9;
double g[200100], f[200100], a[233333];
int n;
double equ(double x) {
  double ans = 0;
  g[0] = 0;
  f[0] = 0;
  double maxn = -1e20, minn = 1e20;
  for (int i = 1; i <= n; i++) {
    f[i] = max(f[i - 1] + a[i] - x, a[i] - x);
    maxn = max(maxn, f[i]);
    g[i] = min(g[i - 1] + a[i] - x, a[i] - x);
    minn = min(minn, g[i]);
  }
  ans = max(maxn, fabs(minn));
  return ans;
}
double ternarySearch(double l, double r) {
  for (int i = 1; i <= 233; i++) {
    double ll = (2 * l + r) / 3;
    double rr = (l + 2 * r) / 3;
    double ans1 = equ(ll);
    double ans2 = equ(rr);
    if (ans1 > ans2)
      l = ll;
    else
      r = rr;
  }
  return l;
}
int main() {
  scanf("%d", &n);
  double maxn = 100000.0;
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
  }
  double ans = ternarySearch(-maxn, maxn);
  ans = equ(ans);
  printf("%.8lf\n", ans);
  return 0;
}
