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;
inline long double Fabs(long double x) {
  if (x < 0) return -x;
  return x;
}
long double eps = 1e-15;
inline long double calc(long double x) {
  long double Mx = -1e30;
  long double sum = 0;
  for (int i = 1; i <= n; ++i) {
    sum += A[i] - x;
    Max(Mx, sum);
    if (sum < 0) sum = 0;
  }
  long double Mn = 1e30;
  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]);
  long double l = -20000, r = 20000;
  for (; Fabs(l - r) > eps;) {
    long double x1 = l + (long double)(r - l) / 3,
                x2 = l + (long double)(r - l) / 3 * 2;
    long double t1 = calc(x1), t2 = calc(x2);
    if (t1 > t2)
      l = x1;
    else
      r = x2;
  }
  printf("%.12lf\n", (double)calc(l));
  return 0;
}
