#include <bits/stdc++.h>
using namespace std;
const int inf = 1e8;
const int maxn = 2e5 + 100;
int n, a[maxn];
double check(double x) {
  double minv = 0.0, maxv = 0.0, ret = 0.0;
  for (int i = 1; i <= n; i++) {
    double tmp = a[i] - x;
    maxv += tmp, minv += tmp;
    ret = max(ret, abs(maxv));
    ret = max(ret, abs(minv));
    if (maxv < 0) maxv = 0;
    if (minv > 0) minv = 0;
  }
  return ret;
}
int main() {
  cin >> n;
  int maxv = -inf, minv = inf;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    maxv = max(maxv, a[i]);
    minv = min(minv, a[i]);
  }
  double l = minv, r = maxv, ans;
  for (int i = 1; i <= 80; i++) {
    double tmp = (r - l) / 3.0;
    double x = l + tmp;
    double y = l + tmp * 2;
    if (check(x) < check(y))
      r = y;
    else
      l = x;
  }
  printf("%.10f", check(l));
  return 0;
}
