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 = 200010;
double a[N], b[N];
int n;
double check(double x) {
  int i;
  double ans, ans1 = 0, ans2 = 0, sum1 = 0, sum2 = 0;
  for (i = 1; i <= n; i++) {
    b[i] = a[i] - x;
  }
  for (i = 1; i <= n; i++) {
    sum1 += b[i];
    if (sum1 < 0) sum1 = 0;
    ans1 = max(sum1, ans1);
    b[i] = -b[i];
  }
  for (i = 1; i <= n; i++) {
    sum2 += b[i];
    if (sum2 < 0) sum2 = 0;
    ans2 = max(sum2, ans2);
  }
  ans = max(ans1, ans2);
  return ans;
}
int main() {
  int i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
  }
  double l = -10000, r = 10000, mid, midl, midr;
  for (i = 1; i <= 100; i++) {
    mid = (r - l) / 3.0;
    midl = l + mid;
    midr = r - mid;
    if (check(midl) > check(midr)) {
      l = midl;
    } else
      r = midr;
  }
  printf("%.8f\n", check(l));
  return 0;
}
