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;
int n;
double a[200010], ans, b[200010], c[200010], sum1[200010], sum2[200010];
double f(double x) {
  double max1 = -100000.0, max2 = -100000.0;
  sum1[0] = sum2[0] = 0.0;
  for (int i = 1; i <= n; i++) {
    b[i] = a[i] - x;
    c[i] = -b[i];
  }
  for (int i = 1; i <= n; i++) {
    sum1[i] = max(sum1[i - 1] + b[i], b[i]);
    max1 = max(max1, sum1[i]);
    sum2[i] = max(sum2[i - 1] + c[i], c[i]);
    max2 = max(max2, sum2[i]);
  }
  return max(max1, max2);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  if (n == 1)
    printf("%.15lf\n", 0);
  else {
    double L = -20000.0, R = 20000.0;
    for (int i = 1; i <= 200; i++) {
      double mid1 = L + (R - L) / 3.0, mid2 = R - (R - L) / 3.0;
      if (f(mid1) < f(mid2)) {
        ans = mid1;
        R = mid2;
      } else {
        ans = mid2;
        L = mid1;
      }
    }
    printf("%.15lf\n", f(ans));
  }
  return 0;
}
