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 cal(double x) {
  double t1 = 0, t2 = 0, maxsum = -1320, minsum = 1320;
  for (int i = 1; i <= n; i++) {
    if (t1 >= 0) {
      t1 += a[i] - x;
    } else {
      t1 = a[i] - x;
    }
    if (t2 <= 0) {
      t2 += a[i] - x;
    } else {
      t2 = a[i] - x;
    }
    maxsum = max(maxsum, t1);
    minsum = min(minsum, t2);
  }
  return max(fabs(maxsum), fabs(minsum));
}
double triple(double L, double R) {
  int t = 100;
  while (t--) {
    double mid = L + (R - L) / 3.0;
    double mmid = R - (R - L) / 3.0;
    if (cal(mid) > cal(mmid))
      L = mid;
    else
      R = mmid;
  }
  return cal(L) > cal(R) ? L : R;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  printf("%.7lf\n", cal(triple(-10005, 10005)));
}
