#include <bits/stdc++.h>
using namespace std;
int n, a[200010];
double getf(long double x) {
  double s = 0, Min = 0, Max = 0;
  for (int i = 1; i <= n; i++) {
    s += (double)a[i] - x;
    Min = min(Min, s);
    Max = max(Max, s);
  }
  return Max - Min;
}
int main() {
  scanf("%d", &n);
  int Min = 1000000, Max = -1000000;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    Min = min(Min, a[i]);
    Max = max(Max, a[i]);
  }
  long double l = Min, r = Max, mid, ma, ml, mr, mb;
  ml = getf(l);
  mr = getf(r);
  while (r - l > 3e-12) {
    mid = (r - l) / 3.0;
    ma = getf(l + mid);
    mb = getf(l + 2 * mid);
    if (ma > mb) {
      ml = ma;
      l = l + mid;
    } else {
      mr = mb;
      r = l + mid + mid;
    }
    if (r - l <= 3e-12) break;
  }
  printf("%.6lf\n", getf(l));
  return 0;
}
