#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000 + 10;
double a[MAXN];
double dp[MAXN];
double f[MAXN];
int n;
double cal(double x) {
  double res = 0;
  f[1] = dp[1] = a[1] - x;
  res = fabs(dp[1]);
  for (int i = 2; i <= n; i++) {
    double tmp = a[i] - x;
    dp[i] = max(tmp, dp[i - 1] + tmp);
    f[i] = min(tmp, tmp + f[i - 1]);
    res = max(res, fabs(dp[i]));
    res = max(res, fabs(f[i]));
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", a + i);
  double L = -MAXN, R = MAXN;
  for (int i = 1; i <= 300; i++) {
    double m1 = L + (R - L) / 3;
    double m2 = R - (R - L) / 2;
    if (cal(m1) < cal(m2)) {
      R = m2;
    } else {
      L = m1;
    }
  }
  printf("%.12f\n", cal(L));
}
