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 n;
double ara[2000005];
double Calculate(double x) {
  double temp1 = 0.0, temp2 = 0.0, pos = 0.0, neg = 0.0;
  for (int i = 1; i <= n; i++) {
    temp1 += (ara[i] - x);
    neg = max(neg, abs(temp1));
    if (temp1 > 0.0) temp1 = 0.0;
  }
  for (int i = 1; i <= n; i++) {
    temp2 += (ara[i] - x);
    pos = max(pos, abs(temp2));
    if (temp2 < 0.0) temp2 = 0.0;
  }
  return max(pos, neg);
}
double ternary_search() {
  double lo = -10000.0, hi = 100000.0, mid1, mid2, ret1, ret2, res, eps = 1e-11;
  while (hi - lo > eps) {
    mid1 = lo + (hi - lo) / 3.0;
    mid2 = hi - (hi - lo) / 3.0;
    ret1 = Calculate(mid1);
    ret2 = Calculate(mid2);
    if (ret1 <= ret2)
      hi = mid2;
    else
      lo = mid1;
  }
  return Calculate(hi);
}
int main() {
  int i;
  double ans;
  scanf("%d", &(n));
  for (i = 1; i <= n; i++) scanf("%lf", &ara[i]);
  ans = ternary_search();
  printf("%0.7f\n", ans);
  return 0;
}
