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 maxn = 200000 + 5;
const double INF = 1e4 + 5;
const double eps = 1e-10;
int a[maxn];
double b[maxn];
double C(double x, int n) {
  double res = 0, temp = 0;
  memcpy(b, a, sizeof(a));
  int flag = 1;
  for (int i = 1; i <= n; ++i) {
    b[i] = a[i] - x;
    if (flag * b[i] <= 0) {
      temp += b[i];
    } else {
      res = max(res, fabs(temp));
      temp = b[i];
      flag = -flag;
    }
  }
  res = max(res, fabs(temp));
  return res;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i) {
      scanf("%d", a + i);
    }
    double lb = -INF, ub = INF;
    while (ub - lb > eps) {
      double m1 = lb + (ub - lb) / 3, m2 = ub - (ub - lb) / 3;
      if (C(m2, n) - C(m1, n) > eps) {
        ub = m2;
      } else {
        lb = m1;
      }
    }
    printf("%.14f\n", C(lb, n));
  }
  return 0;
}
