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 = 2e5 + 5;
double a[maxn];
int n;
double work(double x) {
  double ma = 0.0, mi = 0.0;
  double re = 0.0;
  for (int i = 1; i <= n; i++) {
    double aa = a[i] - x;
    ma += aa, mi += aa;
    if (mi > 0) mi = 0.0;
    if (ma < 0) ma = 0.0;
    re = max(re, max(fabs(mi), ma));
  }
  return re;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  double l = -1e4, r = 1e4, ans = 20000;
  while (l + 1e-6 <= r) {
    double m1 = (l * 2 + r) / 3.0, m2 = (l + r * 2) / 3.0;
    double a1 = work(m1), a2 = work(m2);
    if (a1 <= a2) {
      r = m2 - 1e-6;
    } else
      l = m1 + 1e-6;
  }
  printf("%f\n", work(r));
  return 0;
}
