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[200007];
int n;
double get_max(double x) {
  double maxm = (double)a[n - 1] - x;
  double sum = (double)a[n - 1] - x;
  for (int i = n - 2; i >= 0; i--) {
    sum = max((double)a[i] - x, (double)a[i] - x + sum);
    maxm = max(sum, maxm);
  }
  return maxm;
}
double get_min(double x) {
  double minm = (double)a[n - 1] - x;
  double sum = (double)a[n - 1] - x;
  for (int i = n - 2; i >= 0; i--) {
    sum = min((double)a[i] - x, (double)a[i] - x + sum);
    minm = min(sum, minm);
  }
  return minm;
}
int main() {
  scanf("%d", &n);
  double L, R;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    L = min(L, (double)a[i]);
    R = max(R, (double)a[i]);
  }
  while (R - L > 1e-12) {
    double x1 = L + (R - L) / 3;
    double x2 = L + (R - L) / 3 * 2;
    double ans1 = max(fabs(get_min(x1)), fabs(get_max(x1)));
    double ans2 = max(fabs(get_min(x2)), fabs(get_max(x2)));
    if (ans1 < ans2) {
      R = x2;
    } else if (ans1 >= ans2) {
      L = x1;
    }
  }
  double ans = max(fabs(get_min(L)), fabs(get_max(L)));
  printf("%.10lf\n", ans);
  return 0;
}
