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;
const int MAX_N = 200000;
const double eps = 1e-8;
int n, A[MAX_N + 1];
double ans = 1e20;
double process(double x) {
  int i;
  double mini = 1e20, maxi = -1e20, min = 0, max = 0, a;
  for (i = 1; i <= n; i++) {
    a = A[i] - x;
    min += a, max += a;
    if (min > 0) min = 0;
    if (max < 0) max = 0;
    mini = std::min(min, mini);
    maxi = std::max(max, maxi);
  }
  ans = std::min(ans, std::max(fabs(maxi), fabs(mini)));
  return (fabs(maxi) > fabs(mini));
}
int main() {
  int i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", A + i);
  double a = -10000, b = 10000, m, l;
  while (a + eps < b) {
    m = (a + b) / (double)2;
    l = process(m);
    if (l)
      a = m;
    else
      b = m;
  }
  printf("%.15f", ans);
  return 0;
}
