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 inf = 1e8;
const int maxn = 2e5 + 100;
int n, a[maxn];
double check(double x) {
  double minv = 0.0, maxv = 0.0, ret = 0.0;
  for (int i = 1; i <= n; i++) {
    double tmp = a[i] - x;
    maxv += tmp, minv += tmp;
    ret = max(ret, abs(maxv));
    ret = max(ret, abs(minv));
    if (maxv < 0) maxv = 0;
    if (minv > 0) minv = 0;
  }
  return ret;
}
int main() {
  cin >> n;
  int maxv = -inf, minv = inf;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    maxv = max(maxv, a[i]);
    minv = min(minv, a[i]);
  }
  double l = minv, r = maxv, ans;
  for (int i = 1; i <= 80; i++) {
    double tmp = (r - l) / 3.0;
    double x = l + tmp;
    double y = l + tmp * 2;
    if (check(x) < check(y))
      r = y;
    else
      l = x;
  }
  printf("%.10f", check(l));
  return 0;
}
