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 double INF = 1e10;
const int IT = 200;
const int N = 200100;
int n;
double a[N];
double b[N];
double calcMax() {
  double res = 0;
  double bal = 0;
  for (int i = 0; i < n; i++) {
    res = max(res, bal);
    bal += b[i];
    bal = max(bal, 0.);
  }
  return max(res, bal);
}
double calcMin() {
  double res = 0;
  double bal = 0;
  for (int i = 0; i < n; i++) {
    res = min(res, bal);
    bal += b[i];
    bal = min(bal, 0.);
  }
  return min(res, bal);
}
bool check(double x) {
  for (int i = 0; i < n; i++) b[i] = a[i] - x;
  double A = calcMax();
  double B = calcMin();
  return (-B > A);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  double L = -INF, R = INF;
  for (int it = 0; it < IT; it++) {
    double x = (L + R) / 2;
    if (check(x))
      R = x;
    else
      L = x;
  }
  for (int i = 0; i < n; i++) b[i] = a[i] - L;
  printf("%.12lf\n", calcMax());
  return 0;
}
