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 N = 2 * 100 * 1000;
long double l[N];
long double Maks(long double dod, int n) {
  int i;
  long double as, mi, w;
  mi = 0;
  w = -10000000000000;
  as = 0;
  for (i = 1; i <= n; ++i) {
    as += (l[i] - dod);
    w = max(w, as - mi);
    mi = min(mi, as);
  }
  return w;
}
long double Minim(long double dod, int n) {
  int i;
  long double as, ma, w;
  ma = 0;
  w = 10000000000000;
  as = 0;
  for (i = 1; i <= n; ++i) {
    as += (l[i] - dod);
    w = min(w, as - ma);
    ma = max(ma, as);
  }
  return w;
}
long double TS(long double p, long double k, int n) {
  int i;
  long double s1, s2, w1, w2;
  for (i = 1; i <= 100; ++i) {
    s1 = p + ((k - p) / 3);
    s2 = k - ((k - p) / 3);
    w1 = max(abs(Maks(s1, n)), abs(Minim(s1, n)));
    w2 = max(abs(Maks(s2, n)), abs(Minim(s2, n)));
    if (w1 < w2)
      k = s2;
    else
      p = s1;
  }
  return p;
}
void WczytajLiczby(int &n) {
  int i;
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> l[i];
}
void Weakness() {
  int n;
  long double w;
  WczytajLiczby(n);
  w = TS(-10000, 10000, n);
  w = max(abs(Minim(w, n)), abs(Maks(w, n)));
  cout << fixed << setprecision(10) << w << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  Weakness();
  return 0;
}
