#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
double a[N];
int n, m, i, j, k;
double l, r, f1, f2, u, v;
double solve(double c) {
  int i;
  double sum, ans, l, r;
  l = r = sum = 0;
  for (i = 1; i <= n; i++) {
    sum += a[i] - c;
    l = min(l, sum);
    r = max(r, sum);
  }
  return r - l;
}
int main() {
  scanf("%d", &n);
  l = 1e8;
  r = -1e8;
  for (i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
    r = max(r, a[i]);
    l = min(l, a[i]);
  }
  while (1) {
    u = l + (r - l) / 3;
    v = l + (r - l) / 3 * 2;
    f1 = solve(u);
    f2 = solve(v);
    if (fabs(f1 - f2) <= 1e-8 && fabs(r - l) <= 1e-11) break;
    if (f1 <= f2)
      r = v;
    else
      l = u;
  }
  printf("%.9lf\n", f1);
  return 0;
}
