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 cnt, n;
long long d, ans, st = -1e13, en = 1e13, a[200010], mid;
long long pro(long long x) {
  int i;
  long long sum2 = 0, dap = 0, dap2 = 0;
  for (i = 1; i <= n; i++) {
    a[i] -= x;
    sum2 += a[i];
    if (sum2 < 0) sum2 = 0;
    dap = max(dap, sum2);
  }
  sum2 = 0;
  for (i = 1; i <= n; i++) {
    a[i] = -a[i];
    sum2 += a[i];
    if (sum2 < 0) sum2 = 0;
    dap2 = max(dap2, sum2);
    a[i] = -a[i];
    a[i] += x;
  }
  ans = 0;
  ans = max(ans, dap);
  ans = max(ans, dap2);
  return dap - dap2;
}
int main() {
  int i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    a[i] *= 10000000;
  }
  while (st != en && en != st + 1) {
    mid = (st + en) / 2;
    if (pro(mid) < 0)
      en = mid;
    else
      st = mid + 1;
  }
  printf("%lld.", ans / 10000000);
  d = ans % 10000000;
  while (d) {
    d /= 10;
    cnt++;
  }
  for (i = 1; i <= 7 - cnt; i++) printf("0");
  printf("%d", ans % 10000000);
  return 0;
}
