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>
long long a[262144], n;
long long count(long long x) {
  long long smax = 0, smin = 0, max = 0, min = 0;
  for (int i = 0; i < n; ++i) {
    smax = a[i] - x + (smax > 0 ? smax : 0), max = std::max(max, smax);
    smin = a[i] - x + (smin < 0 ? smin : 0);
    min = std::min(min, smin);
  }
  return std::max(max, -min);
}
int main() {
  long long l, r, ml, mr;
  int k;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &k), a[i] = k * ((long long)1 << 32);
  l = -10000 * ((long long)1 << 32), r = 10000 * ((long long)1 << 32);
  while (l != r) {
    ml = (l + r) >> 1, mr = ml + 1;
    if (count(ml) < count(mr))
      r = ml;
    else
      l = mr;
  }
  printf("%.12f\n", (double)count(l) / ((long long)1 << 32));
  return 0;
}
