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;
int i, j, k, n, m, x, y, T, ans, big, cas, num, len;
bool flag;
double a[200005];
double chk(double x) {
  double pre, pre2, ans, ans2;
  ans = 0;
  ans2 = 0;
  pre = 0;
  pre2 = 0;
  for (int i = 1; i <= n; i++) {
    pre += a[i] - x;
    ans = max(ans, fabs(pre));
    pre = max(pre, 0.0);
    pre2 += a[i] - x;
    ans2 = max(ans2, fabs(pre2));
    pre2 = min(pre2, 0.0);
  }
  return max(fabs(ans), fabs(ans2));
}
int main() {
  scanf("%d", &n);
  double mx = -0x3fffffff, mi = 0x3fffffff;
  for (i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
    mx = max(mx, a[i]);
    mi = min(mi, a[i]);
  }
  double l = mi, r = mx;
  while (true) {
    double m1 = chk((r + 2 * l) / 3);
    double m2 = chk((2 * r + l) / 3);
    if (fabs(m1 - m2) < 1e-6) break;
    if (m1 < m2)
      r = (2 * r + l) / 3;
    else
      l = (r + 2 * l) / 3;
  }
  printf("%.12lf\n", chk(l));
  return 0;
}
