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;
long long a[310001], l, r, m;
int i, j, k, n, ans;
bool check2(long long x, long long d) {
  long long s;
  int i;
  for (i = 1, s = 0; i <= n; i++) {
    s += a[i] - d;
    if (s < 0) s = 0;
    if (s > x) return 0;
  }
  return 1;
}
bool check(long long x) {
  long long s;
  int i, k, l, r, m;
  for (l = 0, r = 60000; l < r - 1;) {
    m = (l + r) >> 1;
    if (check2(x, m))
      r = m;
    else
      l = m + 1;
  }
  k = check2(x, l) ? l : r;
  for (i = 1, s = 0; i <= n; i++) {
    s += a[i] - k;
    if (s > 0) s = 0;
    if (s < -x) return 0;
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]), a[i] = (a[i] + 11000) * 2;
  for (l = 0, r = 6000000000LL; l < r - 1;) {
    m = (l + r) >> 1;
    if (check(m))
      r = m;
    else
      l = m + 1;
  }
  ans = (check(l)) ? l : r;
  printf("%.9lf\n", ans / 2.0);
  return 0;
}
