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 M = 200005;
int A[M];
double B[M];
int n;
double check(double x) {
  for (int i = 1, i_END_ = n + 1; i < i_END_; ++i) B[i] = A[i] - x;
  double mx = -1e60, mi = 1e60, s1 = 0, s2 = 0;
  for (int i = 1, i_END_ = n + 1; i < i_END_; ++i) {
    s1 += B[i];
    mx = max(s1, mx);
    if (s1 < 0) s1 = 0;
    s2 += B[i];
    mi = min(mi, s2);
    if (s2 > 0) s2 = 0;
  }
  return max(mx, -mi);
}
int main() {
  scanf("%d", &n);
  for (int i = 1, i_END_ = n + 1; i < i_END_; ++i) scanf("%d", &A[i]);
  double L = -10000, R = 10000, res = -10001;
  double ans = 1e60;
  for (int i = 0, i_END_ = 100; i < i_END_; ++i) {
    double del = (R - L) / 3;
    double m1 = L + del, m2 = R - del;
    double r1 = check(m1), r2 = check(m2);
    ans = min(ans, min(r1, r2));
    if (r2 < r1)
      L = m1;
    else
      R = m2;
  }
  printf("%.12f\n", ans);
  return 0;
}
