#include <bits/stdc++.h>
using namespace std;
const double eps = 3e-12;
const int N = (int)2e6 + 10;
double a[N], b[N];
int n;
double maxSum(double a[]) {
  double ans = 0, tmp = 0;
  for (int i = 0; i < n; i++) {
    tmp += a[i];
    if (tmp < 0) tmp = 0;
    ans = max(ans, tmp);
  }
  return ans;
}
double calc(double x) {
  for (int i = 0; i < n; i++) b[i] = a[i] - x;
  double ans1 = maxSum(b);
  for (int i = 0; i < n; i++) b[i] *= -1;
  double ans2 = maxSum(b);
  return max(ans1, ans2);
}
double Search() {
  double left = -1e4, right = 1e4;
  double midl, midr;
  while (right - left > eps) {
    midl = (2 * left + right) / 3.0;
    midr = (left + 2 * right) / 3.0;
    double w1 = calc(midl);
    double w2 = calc(midr);
    if (w1 < w2)
      right = midr;
    else
      left = midl;
  }
  return calc(right);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  printf("%.15f\n", Search());
  return 0;
}
