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 maxn = 2e6 + 10;
double a[maxn];
double f(double x, int n) {
  double ret = 0;
  double lo = 0;
  double hi = 0;
  for (int i = 0; i < n; ++i) {
    hi += a[i] - x;
    lo += a[i] - x;
    if (hi <= 0) {
      hi = 0;
    }
    if (lo >= 0) {
      lo = 0;
    }
    ret = max(abs(lo), max(hi, ret));
  }
  return ret;
}
int main() {
  int n;
  double mi = 1e9;
  double ma = -1e9;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    ma = max(ma, a[i]);
    mi = min(mi, a[i]);
  }
  double lo = mi;
  double hi = ma;
  while (hi - lo > 1e-10) {
    double x1 = lo + (hi - lo) / 3;
    double x2 = hi - (hi - lo) / 3;
    double vx1 = f(x1, n);
    double vx2 = f(x2, n);
    if (vx1 < vx2) {
      hi = x2;
    } else {
      lo = x1;
    }
  }
  cout << f((hi + lo) / 2, n);
  return 0;
}
