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[220005];
double b[220005];
int n;
double check(double x) {
  double q1 = 0.0, q2 = 0.0, q3 = 0.0;
  for (int i = 1; i <= n; i++) b[i] = a[i] - x;
  for (int i = 1; i <= n; i++) q1 = max(b[i], b[i] + q1), q3 = max(q1, q3);
  for (int i = 1; i <= n; i++) b[i] = (-1.0) * b[i];
  for (int i = 1; i <= n; i++) q2 = max(b[i], b[i] + q2), q3 = max(q3, q2);
  return q3;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  double l, r;
  l = -30000.0, r = 30000.0;
  while (r - l > 1e-11) {
    double mid1 = (l + r) / 2.0;
    double mid2 = (mid1 + r) / 2.0;
    if (check(mid1) >= check(mid2))
      l = mid1;
    else
      r = mid2;
  }
  printf("%.13lf\n", check((l + r) / (2.0)));
  return 0;
}
