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 long int N;
vector<long long int> as;
double f(double x) {
  double m = 0, vp = 0, vn = 0;
  for (long long int n = 0; n < N; ++n) {
    double a = as[n] - x;
    if (a > 0) {
      vp += a;
      vn = 0;
    } else {
      vp = 0;
      vn -= a;
    }
    m = max(m, max(vp, vn));
  }
  return m;
}
int main(int argc, char* argv[]) {
  std::ios::sync_with_stdio(false);
  cin >> N;
  as.resize(N);
  for (long long int n = 0; n < N; ++n) cin >> as[n];
  long long int mabs = 0;
  for (long long int n = 0; n < N; ++n) mabs = max(abs(as[n]), mabs);
  double lo = -mabs, up = mabs;
  while (up > lo + 1e-8) {
    double one = (2 * lo + up) / 3;
    double two = (lo + 2 * up) / 3;
    if (f(two) > f(one))
      up = two;
    else
      lo = one;
  }
  cout << setprecision(14) << f((lo + up) / 2) << endl;
  return 0;
}
