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];
int n;
double f(double x) {
  double ans1 = 0, ans2 = 0;
  double ansans1 = 0, ansans2 = 0;
  for (int i = 0; i < n; i++) {
    ans1 = max(ans1 + (a[i] - x), (a[i] - x));
    ansans1 = max(ans1, ansans1);
    ans2 = min(ans2 + (a[i] - x), (a[i] - x));
    ansans2 = min(ans2, ansans2);
  }
  return max(ansans1, -ansans2);
}
double sanfen(double l, double r) {
  double mid, midmid, fmid, fmidmid;
  mid = (l + r) / 2;
  midmid = (mid + r) / 2;
  fmid = f(mid);
  fmidmid = f(midmid);
  while (r - l > 0.0000001) {
    if (fmid > fmidmid) {
      l = mid;
      mid = midmid;
      fmid = fmidmid;
      midmid = (mid + r) / 2;
      fmidmid = f(midmid);
    } else {
      r = midmid;
      midmid = mid;
      fmidmid = fmid;
      mid = (l + midmid) / 2;
      fmid = f(mid);
    }
  }
  return fmid;
}
int main() {
  scanf("%d", &n);
  int ma = -10000, i;
  int mi = 10000;
  for (i = 0; i < (n); i++) {
    scanf("%d", &a[i]);
    ma = max(a[i], ma);
    mi = min(a[i], mi);
  }
  printf("%.12lf\n", sanfen(mi, ma));
  return 0;
}
