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 long double eps = 0.0000000001;
int n, a[200002];
long double x, low = 11111111, high = -11111111, le, ri, u, v;
long double ab(long double u) { return (u > 0) ? u : -u; }
long double subsum(long double x) {
  long double l = 0, u = 0;
  for (int i = 1; i <= n; i++) {
    l = (l > 0) * l + a[i] - x;
    if (l > 0 && u < ab(l)) u = ab(l);
  }
  for (int i = 1; i <= n; i++) {
    l = (l < 0) * l + a[i] - x;
    if (l < 0 && u < ab(l)) u = ab(l);
  }
  return u;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
  }
  while (ab(high - low) > eps) {
    le = (high + high + low) / 3;
    ri = (high + low + low) / 3;
    u = subsum(le);
    if (ab(ri - le) < eps) {
      cout << setprecision(15) << fixed;
      cout << u;
      exit(0);
    }
    v = subsum(ri);
    if (u > v) {
      high = le;
    } else if (u < v) {
      low = ri;
    } else if (ab(u - v) < eps) {
      high = le, low = ri;
    }
  }
  return 0;
}
