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 N = 200005;
double a[N], b[N], sum1[N], sum2[N], c[N];
int n;
double judge(double x) {
  double maxnum = 0;
  for (int i = 1; i <= n; i++) {
    b[i] = a[i] - x;
    sum1[i] = max(b[i], sum1[i - 1] + b[i]);
    maxnum = max(maxnum, sum1[i]);
    c[i] = x - a[i];
    sum2[i] = max(c[i], sum2[i - 1] + c[i]);
    maxnum = max(maxnum, sum2[i]);
  }
  return maxnum;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      scanf("%lf", a + i);
    }
    double l = -20000, r = 20000;
    while (r - l >= 1e-10) {
      double m1 = l + (r - l) / 3;
      double m2 = l + (r - l) * 2 / 3;
      if (judge(m1) > judge(m2)) {
        l = m1;
      } else {
        r = m2;
      }
    }
    printf("%.12lf\n", judge(l));
  }
  return 0;
}
