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;
long double a[200100], b[200100];
int n;
long double tru(long double x) {
  int k;
  long double max = 0, pos = 0, neg = 0;
  for (k = 1; k <= n; k++) {
    b[k] = a[k] + x;
  }
  for (k = 1; k <= n; k++) {
    pos += b[k];
    neg += b[k];
    if (fabs(pos) > max) max = fabs(pos);
    if (fabs(neg) > max) max = fabs(neg);
    if (pos < 0) pos = 0;
    if (neg > 0) neg = 0;
  }
  return max;
}
int main() {
  int k;
  cin >> n;
  long double d = 1e-12, l = -123034, r = 171022, p, q, m;
  for (k = 1; k <= n; k++) cin >> a[k];
  for (k = 1; k <= 100; k++) {
    m = (l + r) / 2;
    p = tru(m);
    q = tru(m + d);
    if (p > q)
      l = m;
    else
      r = m;
  }
  cout << setprecision(12) << tru(m);
}
