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 int MOD = 1e9 + 7;
const int maxn = 300009;
const int maxm = 300009;
const double pi = acos(-1.0);
const double eps = 1e-12;
double data[maxn], sum, maxx, minx;
double tmp[maxn];
double f2(double x, int n) {
  for (int i = 1; i <= n; i++) tmp[i] = data[i] - x;
  double ans = 0.0;
  double tmpp = tmp[1], tmpn = tmp[1];
  for (int i = 2; i <= n; i++) {
    if (tmpp > 0)
      tmpp += tmp[i];
    else
      tmpp = tmp[i];
    ans = max(tmpp, ans);
    if (tmpn < 0)
      tmpn += tmp[i];
    else
      tmpn = tmp[i];
    ans = max(-tmpn, ans);
  }
  ans = max(ans, max(tmpp, -tmpn));
  return ans;
}
double sanfen(int n) {
  double l = minx, r = maxx, mid = l + (r - l) / 3., midd = r - (r - l) / 3.;
  while (fabs(l - r) > eps) {
    double fmid = f2(mid, n), fmidd = f2(midd, n);
    if (fmid < fmidd)
      r = midd;
    else
      l = mid;
    mid = l + (r - l) / 3., midd = r - (r - l) / 3.;
  }
  return f2((l + r) / 2., n);
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    maxx = -10000.;
    minx = 10000.;
    sum = 0.0;
    for (int i = 1; i <= n; i++)
      scanf("%lf", &data[i]), sum += data[i], maxx = max(maxx, data[i]),
                                              minx = min(minx, data[i]);
    printf("%.15f\n", sanfen(n));
  }
  return 0;
}
