#include <bits/stdc++.h>
using namespace std;
const long long INF = 3000000000;
int n, m;
double a[2000010];
double judge(double mid) {
  double p1 = 0.0, p2 = 0.0, tmp, sum = 0.0;
  for (int i = 1; i <= n; i++) {
    tmp = a[i] - mid;
    p1 = max(p1 + tmp, tmp);
    sum = max(sum, p1);
    tmp = -tmp;
    p2 = max(p2 + tmp, tmp);
    sum = max(sum, p2);
  }
  return sum;
}
int main() {
  scanf("%d", &n);
  double L = 20000.0, R = -20000.0;
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
    L = min(L, a[i]);
    R = max(R, a[i]);
  }
  while (R - L > 1e-11) {
    double Lmid = (L + L + R) / 3.0;
    double Rmid = (L + R + R) / 3.0;
    if (judge(Lmid) >= judge(Rmid))
      L = Lmid;
    else
      R = Rmid;
  }
  printf("%.12lf\n", judge((L + R) / 2));
  return 0;
}
