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;
double a[1234567], b[200030];
int n;
double fun() {
  int i;
  double maxend = 0.0000, maxsofar = 0.000000;
  for (i = 0; i < n; i++) {
    maxend = max(b[i], maxend + b[i]);
    maxsofar = max(maxsofar, maxend);
  }
  return maxsofar;
}
int main() {
  cin >> n;
  int i;
  for (i = 0; i < n; i++) cin >> a[i];
  double lo = -1e9, hi = 1e9, m1, m2;
  int t = 100;
  while (t--) {
    double mid = (lo + hi) / 2;
    for (i = 0; i < n; i++) b[i] = a[i] - mid;
    m1 = fun();
    for (i = 0; i < n; i++) b[i] = b[i] * (-1);
    m2 = fun();
    if (m1 > m2)
      lo = mid;
    else
      hi = mid;
  }
  printf("%.12lf\n", max(m1, m2));
  return 0;
}
