#include <bits/stdc++.h>
using namespace std;
void Rd(int &res) {
  res = 0;
  char p;
  int k = 1;
  while (p = getchar(), !(p >= '0' && p <= '9') && p != '-')
    ;
  if (p == '-') k = -1, p = getchar();
  do {
    res = (res << 1) + (res << 3) + (p ^ 48);
  } while (p = getchar(), p >= '0');
  res *= k;
}
int a[200005], n;
bool gre(double a, double b) { return a - b > 0.0000000001; }
double calc(double pl) {
  double Mx = 0, Mi = 0, Mxsum = 0, Misum = 0, bas = 0;
  for (int i = 1; i <= n; i++) {
    if (gre(bas, Mxsum)) Mxsum = bas;
    if (gre(bas, Misum)) Misum = bas;
    Mxsum += a[i] - pl;
    Misum -= a[i] - pl;
    if (gre(Mxsum, Mx)) Mx = Mxsum;
    if (gre(Misum, Mi)) Mi = Misum;
  }
  if (gre(Mi, Mx))
    return -1;
  else
    return Mx;
}
int main() {
  Rd(n);
  for (int i = 1; i <= n; i++) Rd(a[i]);
  double l = -10000, r = 10000, ans = 0;
  for (int i = 1; i <= 100; i++) {
    double mid = (l + r) / 2;
    double lp = calc(mid);
    if (gre(lp, 0))
      ans = lp, l = mid;
    else
      r = mid;
  }
  printf("%.15lf\n", ans);
  return 0;
}
