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[200007];
int n;
double cal(double x) {
  double s, maxx, minn;
  maxx = a[0] - x;
  s = 0;
  for (int i = 0; i < n; i++) {
    if (s < 0)
      s = a[i] - x;
    else
      s = s + a[i] - x;
    if (s > maxx) maxx = s;
  }
  minn = a[0] - x;
  s = 0;
  for (int i = 0; i < n; i++) {
    if (s > 0)
      s = a[i] - x;
    else
      s = s + a[i] - x;
    if (s < minn) minn = s;
  }
  return max(fabs(maxx), fabs(minn));
}
int main() {
  while (scanf("%d", &n) == 1) {
    double L = 100000, R = -100000, mid, mmid, t1, t2, ans;
    for (int i = 0; i < n; i++) {
      scanf("%lf", a + i);
      L = min(a[i], L);
      R = max(a[i], R);
    }
    for (int i = 0; i < 200; i++) {
      mid = L + (R - L) / 3;
      mmid = R - (R - L) / 3;
      t1 = cal(mid);
      t2 = cal(mmid);
      if (t1 < t2)
        R = mmid, ans = t1;
      else
        L = mid, ans = t2;
    }
    printf("%.16f\n", ans);
  }
  return 0;
}
