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;
const int N = 210003;
double a[N], b[N];
int n;
double checkMa(double x) {
  for (int i = 1; i <= n; i++) b[i] = a[i] - x;
  double ans = 0, tpans = 0;
  for (int i = 1; i <= n; i++) {
    tpans += b[i];
    if (tpans < 0) tpans = 0;
    ans = max(ans, tpans);
  }
  for (int i = 1; i <= n; i++) b[i] = -b[i];
  tpans = 0;
  for (int i = 1; i <= n; i++) {
    tpans += b[i];
    if (tpans < 0) tpans = 0;
    ans = max(ans, tpans);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
  }
  double r = 10005, l = -10005;
  int times = 100;
  while (fabs(r - l) > 1e-13 && times) {
    times--;
    if (times <= 0) break;
    double lm = (2.0 * l + r) / 3.0;
    double rm = (2.0 * r + l) / 3.0;
    if (checkMa(lm) < checkMa(rm)) {
      r = rm;
    } else
      l = lm;
  }
  printf("%.10f\n", checkMa(l));
  return 0;
}
