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;
int n;
long double a[200005], b[200005];
long double fun(long double x) {
  for (int i = 0; i < n; i++) {
    b[i] = a[i] - x;
  }
  long double msum = b[0];
  long double ans = b[0];
  int i;
  for (i = 1; i < n; i++) {
    msum = max(b[i], msum + b[i]);
    ans = max(ans, msum);
  }
  long double msum1 = b[0];
  long double ans1 = b[0];
  for (i = 1; i < n; i++) {
    msum1 = min(msum1 + b[i], b[i]);
    ans1 = min(ans1, msum1);
  }
  return max(abs(ans), abs(ans1));
}
int main() {
  cin >> n;
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long double lo = -2000000200, hi = 2000000200;
  long double m1, m2, ans;
  long double eps = 1e-13;
  while (hi - lo > eps) {
    m1 = lo + (hi - lo) / 3;
    m2 = hi - (hi - lo) / 3;
    long double val1 = fun(m1);
    long double val2 = fun(m2);
    if (val1 < val2) {
      hi = m2;
    } else {
      lo = m1;
    }
  }
  ans = fun(lo);
  cout << fixed << setprecision(10) << ans;
  return 0;
}
