#include <bits/stdc++.h>
using namespace std;
double a[200006];
int n;
double kadane(int flag, double x) {
  double res = (-1.0) * 1e18;
  double temp = 0.0;
  for (int i = 1; i <= n; i++) {
    if (flag)
      temp += x - a[i];
    else
      temp += a[i] - x;
    res = max(res, temp);
    temp = max(0.0, temp);
  }
  return res;
}
double cal(double x) {
  double res1, res2;
  res1 = kadane(0, x);
  res2 = kadane(1, x);
  return max(res1, res2);
}
double ternary_search(double l, double r) {
  double eps = 200;
  while (eps--) {
    double m1 = l + (r - l) / 3.0;
    double m2 = r - (r - l) / 3.0;
    double f1 = cal(m1);
    double f2 = cal(m2);
    if (f1 > f2)
      l = m1;
    else
      r = m2;
  }
  return cal(l);
}
int main(int argc, char const *argv[]) {
  double mn, mx;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
  }
  printf("%.10lf\n", ternary_search(-10000.0, 10000.0));
  return 0;
}
