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[200010];
double b[200010];
double l, r, m, ans1, ans2, res1, res2, ans;
int i, n, x;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &x), a[i] = x + 10000;
  l = 0;
  r = 20000;
  ans = 4000000000000LL;
  for (int t = 1; t <= 100; t++) {
    m = (l + r) / 2;
    for (i = 1; i <= n; i++) a[i] -= m;
    for (i = 1; i <= n; i++) b[i] = (a[i] * (-1));
    ans1 = ans2 = res1 = res2 = 0;
    for (i = 1; i <= n; i++) {
      ans1 += a[i];
      ans2 += b[i];
      res1 = max(res1, ans1);
      res2 = max(res2, ans2);
      if (ans1 < 0) ans1 = 0;
      if (ans2 < 0) ans2 = 0;
    }
    if (res1 < res2) {
      ans = min(ans, res2);
      r = m;
    } else {
      ans = min(ans, res1);
      l = m;
    }
    for (i = 1; i <= n; i++) a[i] += m;
  }
  printf("%.14f\n", ans);
}
