#include <bits/stdc++.h>
using namespace std;
inline void Rd(int &res) {
  char c;
  res = 0;
  while (c = getchar(), c < '0')
    ;
  do {
    res = (res << 1) + (res << 3) + (c ^ 48);
  } while (c = getchar(), c >= '0');
}
const int M = 200005;
int A[M], n;
double sum[M];
double check(double x) {
  double res = 0;
  sum[0] = 0;
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + A[i] - x;
  double mx = 0, mi = 0;
  for (int i = 1; i <= n; i++) {
    if (mx - sum[i] > res) res = mx - sum[i];
    if (sum[i] - mi > res) res = sum[i] - mi;
    if (sum[i] > mx) mx = sum[i];
    if (sum[i] < mi) mi = sum[i];
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  double L = -20000, R = 20000, ans;
  for (int i = 1; i <= 300; i++) {
    double mid1 = L + (R - L) / 3;
    double mid2 = L + 2 * (R - L) / 3;
    double rs1 = check(mid1);
    double rs2 = check(mid2);
    if (rs1 < rs2) {
      ans = rs1;
      R = mid2;
    } else {
      ans = rs2;
      L = mid1;
    }
  }
  printf("%.15f\n", ans);
  return 0;
}
