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 = 200005;
const int slt = 200;
double C[MAXN], S[MAXN];
int A[MAXN], N;
void prep(double x) {
  for (int i = 1; i <= N; i++) C[i] = A[i] * 1.0 - x;
}
double findm() {
  double res = 1e18;
  S[0] = 0;
  double M = 0;
  for (int i = 1; i <= N; i++) {
    S[i] = S[i - 1] + C[i];
    res = min(res, S[i] - M);
    M = max(M, S[i]);
  }
  return res;
}
double findM() {
  double res = -1e18;
  S[0] = 0;
  double m = 0;
  for (int i = 1; i <= N; i++) {
    S[i] = S[i - 1] + C[i];
    res = max(res, S[i] - m);
    m = min(m, S[i]);
  }
  return res;
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  double l = -1e4, r = 1e4, res = 1e18;
  for (int i = 1; i <= slt; i++) {
    double mid = (l + r) / 2.0;
    prep(mid);
    double m = findm(), M = findM();
    res = min(res, max(abs(m), abs(M)));
    if (abs(m) > abs(M))
      r = mid;
    else
      l = mid;
  }
  printf("%.9f\n", res);
  return 0;
}
