10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#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;
}
