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;
template <class T>
inline bool RD(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1, ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
template <class T>
inline void PT(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) PT(x / 10);
  putchar(x % 10 + '0');
}
const int N = 2e5 + 100;
double a[N];
double b[N];
const double esp = 1e-10;
int n;
double cal(double x) {
  for (int i = 1; i <= int(n); i++) b[i] = a[i] - x;
  double ans = 0;
  double tmp = 0;
  double ma = -1e20;
  for (int i = 1; i <= int(n); i++) {
    tmp += b[i];
    tmp = max(tmp, (double)0);
    ma = max(ma, tmp);
  }
  ans = max(ans, ma);
  tmp = 0;
  ma = -1e20;
  for (int i = 1; i <= int(n); i++) {
    tmp += -b[i];
    tmp = max(tmp, (double)0);
    ma = max(ma, tmp);
  }
  ans = max(ans, ma);
  return ans;
}
int main() {
  RD(n);
  for (int i = 1; i <= int(n); i++) {
    scanf("%lf", &a[i]);
  }
  double lb = -10000 - 100, ub = 10000 + 100;
  double mid;
  for (int c = 1; c <= int(200); c++) {
    mid = (lb + ub) / 2;
    double nxt = mid + esp;
    double a = cal(mid);
    double b = cal(nxt);
    if (a < b) {
      ub = mid;
    } else
      lb = mid;
  }
  printf("%.10f\n", cal(int(mid * 1e6) / 1e6));
}
