#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;
}
