#include <bits/stdc++.h>
using namespace std;
const double EXP = 1e-11;
const int maxn = 2e5 + 10;
int n;
double a[maxn];
double a2[maxn];
double Judge(double x) {
  double sum1 = 0.0, sum2 = 0.0, sum3 = 0.0;
  for (int i = 1; i <= n; i++) a2[i] = a[i] - x;
  for (int i = 1; i <= n; i++) {
    sum1 = max(sum1 + a2[i], a2[i]);
    sum3 = max(sum3, sum1);
  }
  for (int i = 1; i <= n; i++) a2[i] = a2[i] * (-1.0);
  for (int i = 1; i <= n; i++) {
    sum2 = max(sum2 + a2[i], a2[i]);
    sum3 = max(sum3, sum2);
  }
  return sum3;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  double l = -40000.0, r = 40000.0;
  while (r - l > EXP) {
    double mid = (l + l + r) / 3.0;
    double mmid = (l + r + r) / 3.0;
    if (Judge(mid) >= Judge(mmid))
      l = mid;
    else
      r = mmid;
  }
  printf("%.13lf\n", min(Judge(l), Judge(r)));
  return 0;
}
