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>
const long long INF = 1ll << 30;
const double eps = 1e-7;
const int MAXN = 200001;
int n, a[MAXN];
double s[MAXN], c[MAXN];
bool mincheck(double ans, double d) {
  for (int i = 0; i <= n; i++) c[i] = s[i] - i * ans;
  double zmax = 0, ret = INF;
  for (int i = 1; i <= n; i++) {
    ret = std::min(ret, c[i] - zmax);
    zmax = std::max(zmax, c[i]);
  }
  return ret <= -d;
}
bool maxcheck(double ans, double d) {
  for (int i = 0; i <= n; i++) c[i] = s[i] - i * ans;
  double zmin = 0, ret = -INF;
  for (int i = 1; i <= n; i++) {
    ret = std::max(ret, c[i] - zmin);
    zmin = std::min(zmin, c[i]);
  }
  return d <= ret;
}
double getmax(double ans) {
  double left = 0, right = INF;
  while (fabs(right - left) > eps) {
    double mid = (left + right) / 2.0;
    if (maxcheck(mid, ans))
      left = mid;
    else
      right = mid;
  }
  return left;
}
double getmin(double ans) {
  double left = 0, right = INF;
  while (fabs(right - left) > eps) {
    double mid = (left + right) / 2.0;
    if (mincheck(mid, ans))
      right = mid;
    else
      left = mid;
  }
  return left;
}
bool check(double ans) {
  for (int i = 1; i <= n; i++) s[i] = s[i - 1] + a[i];
  return getmax(ans) <= getmin(ans);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  double left = 0, right = INF;
  while (fabs(right - left) > eps) {
    double mid = (left + right) / 2.0;
    if (check(mid))
      right = mid;
    else
      left = mid;
  }
  printf("%.10f\n", left);
  return 0;
}
