#include <bits/stdc++.h>
using namespace std;
double a[220005];
double b[220005];
int n;
double check(double x) {
  double q1 = 0.0, q2 = 0.0, q3 = 0.0;
  for (int i = 1; i <= n; i++) b[i] = a[i] - x;
  for (int i = 1; i <= n; i++) q1 = max(b[i], b[i] + q1), q3 = max(q1, q3);
  for (int i = 1; i <= n; i++) b[i] = (-1.0) * b[i];
  for (int i = 1; i <= n; i++) q2 = max(b[i], b[i] + q2), q3 = max(q3, q2);
  return q3;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  double l, r;
  l = -30000.0, r = 30000.0;
  while (r - l > 1e-11) {
    double mid1 = (l + r) / 2.0;
    double mid2 = (mid1 + r) / 2.0;
    if (check(mid1) >= check(mid2))
      l = mid1;
    else
      r = mid2;
  }
  printf("%.13lf\n", check((l + r) / (2.0)));
  return 0;
}
