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;
void RI() {}
template <typename... T>
void RI(int &head, T &...tail) {
  scanf("%d", &head);
  RI(tail...);
}
const int N = 2e5 + 10;
double mcs(int n, double a[N]) {
  double mx = 0, now = 0;
  for (int i = 0; i < int(n); i++) {
    now += a[i];
    if (now > mx) mx = now;
    if (now < 0) now = 0;
  }
  return mx;
}
int n, a[N];
double b[N];
void calc(double m, double &vp, double &vn) {
  for (int i = 0; i < int(n); i++) b[i] = a[i] - m;
  vp = mcs(n, b);
  for (int i = 0; i < int(n); i++) b[i] *= -1;
  vn = mcs(n, b);
}
int main() {
  RI(n);
  for (int i = 0; i < int(n); i++) RI(a[i]);
  double l = *min_element(a, a + n);
  double r = *max_element(a, a + n);
  for (int t = 0; t < int(100); t++) {
    double m = (l + r) / 2, vp, vn;
    calc(m, vp, vn);
    if (vp > vn)
      l = m;
    else
      r = m;
  }
  double m = (l + r) / 2, vp, vn;
  calc(m, vp, vn);
  printf("%.12f\n", max(vp, vn));
  return 0;
}
