#include <bits/stdc++.h>
using namespace std;
int n;
int a[200005];
double check(double mid) {
  double ans = 0.0;
  double x = 0.0, y = 0.0;
  double hamada = 0.0;
  for (int i = 0; i < n; i++) {
    hamada += a[i] - mid;
    ans = max(ans, max(fabs(hamada - x), fabs(hamada - y)));
    x = max(x, hamada);
    y = min(y, hamada);
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  double lo = -10000.0, hi = 10000.0;
  int x = 0;
  while (x++ < 500) {
    double mid1 = (lo + lo + hi) / 3.0, mid2 = (hi + hi + lo) / 3.0;
    if (check(mid1) > check(mid2)) {
      lo = mid1;
    } else
      hi = mid2;
  }
  printf("%.12lf", check((lo + hi) / 2.0));
  return 0;
}
