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>
void rd(T &a) {
  a = 0;
  char c;
  while (c = getchar(), !isdigit(c))
    ;
  do a = a * 10 + (c ^ 48);
  while (c = getchar(), isdigit(c));
}
template <class T>
void Min(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
void Max(T &a, T b) {
  if (a < b) a = b;
}
const int M = 2e5 + 5;
int A[M], n;
double eps = 1e-10;
inline double calc(double x) {
  double Mx = -1e20;
  double sum = 0;
  for (int i = 1; i <= n; ++i) {
    sum += A[i] - x;
    Max(Mx, sum);
    if (sum < 0) sum = 0;
  }
  double Mn = 1e20;
  sum = 0;
  for (int i = 1; i <= n; ++i) {
    sum += A[i] - x;
    Min(Mn, sum);
    if (sum > 0) sum = 0;
  }
  return max(fabs(Mx), fabs(Mn));
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &A[i]);
  double l = -10000, r = 10000;
  for (; fabs(l - r) > eps;) {
    double x1 = l + (double)(r - l) / 3, x2 = l + (double)(r - l) / 3 * 2;
    double t1 = calc(x1), t2 = calc(x2);
    if (t1 > t2)
      l = x1;
    else
      r = x2;
  }
  printf("%.9lf\n", calc(l));
  return 0;
}
