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, a[200010];
double calc(double val) {
  double minres = 200010 * 30010, maxres = -200010 * 30010, smin = 0, smax = 0,
         cur = 0;
  for (int i = 1; i <= n; ++i) {
    cur += a[i] - val;
    minres = min(minres, cur - smax);
    maxres = max(maxres, cur - smin);
    smin = min(cur, smin);
    smax = max(cur, smax);
  }
  return max(abs(minres), abs(maxres));
}
double ans() {
  double l = -20000.0, r = 20000.0;
  while (r - l > 1e-7) {
    double tl = (2 * l + r) / 3, tr = (2 * r + l) / 3;
    double res_tl = calc(tl), res_tr = calc(tr);
    if (res_tl - res_tr > 1e-7)
      l = tl;
    else if (res_tl - res_tr < 1e-7)
      r = tr;
    else if (res_tl - res_tr == 1e-7)
      return res_tl;
  }
  return (l + r) / 2;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  printf("%0.6lf", calc(ans()));
}
