#include <bits/stdc++.h>
using namespace std;
double a[222222], b[222222];
int n;
double f(double x) {
  for (int i = 0; i < n; i++) b[i] = a[i] - x;
  double MAX = -0x3f3f3f3f, ans = 0;
  for (int i = 0; i < n; i++) {
    ans += b[i];
    MAX = max(ans, MAX);
    if (ans < 0) ans = 0;
  }
  double MIN = 0x3f3f3f3f;
  ans = 0;
  for (int i = 0; i < n; i++) {
    ans += b[i];
    MIN = min(ans, MIN);
    if (ans > 0) ans = 0;
  }
  return max(fabs(MIN), fabs(MAX));
}
int main() {
  scanf("%d", &n);
  double l = 0x3f3f3f3f, r = -0x3f3f3f3f;
  for (int i = 0; i < n; i++) {
    scanf("%lf", &a[i]);
    l = min(a[i], l);
    r = max(a[i], r);
  }
  while (1) {
    if (r - l <= 1e-11) break;
    double mid = (l + r) / 2;
    double mmid = (mid + r) / 2;
    if (f(mid) <= f(mmid))
      r = mmid;
    else
      l = mid;
  }
  double goal = (l + r) / 2;
  printf("%.15f\n", f(goal));
  return 0;
}
