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, a[200010];
const long double eps = 1e-10;
long double f(long double d) {
  int i;
  long double res = 0.0, prev = 0.0;
  for (i = 0; i < N; i++) {
    if (prev < 0.0)
      prev = a[i] - d;
    else
      prev += a[i] - d;
    if (res < prev) res = prev;
  }
  for (i = 0, prev = 0.0; i < N; i++) {
    if (prev < 0.0)
      prev = d - a[i];
    else
      prev += d - a[i];
    if (res < prev) res = prev;
  }
  return res;
}
int main() {
  int i;
  long double l = 0.0, r = 30000.0, m, t = 0.0, f1, f2;
  cin >> N;
  for (i = 0; i < N; i++) cin >> a[i];
  while (r - l > eps) {
    m = (r + l) / 2.0;
    f1 = f(m);
    f2 = f(m + eps);
    if (f1 < f2) {
      t = f1;
      r = m;
    } else {
      t = f2;
      l = m + eps;
    }
  }
  cout.precision(20);
  cout << fixed << t << endl;
  return 0;
}
