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 a[200005], n;
double judge(double x) {
  double ret = 0, sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += a[i] - x;
    if (sum < 0)
      sum = 0;
    else {
      ret = max(ret, sum);
    }
  }
  sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += x - a[i];
    if (sum < 0)
      sum = 0;
    else {
      ret = max(ret, sum);
    }
  }
  return ret;
}
int main() {
  double l = 10000, r = -10000, mid, mid1, mid2, t, t1, t2;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    l = min(l, 1.0 * a[i]);
    r = max(r, 1.0 * a[i]);
  }
  double p, q;
  while (r - l >= 2e-12) {
    p = (2 * l + r) / 3;
    q = (2 * r + l) / 3;
    t1 = judge(p);
    t2 = judge(q);
    if (t1 < t2)
      r = q;
    else
      l = p;
  }
  printf("%.7lf", t1);
  return 0;
}
