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 double EPS = 1e-7;
int n;
double num[200020];
double get_posi(double k) {
  double res = -1;
  double sum = 0;
  for (int i = 0; i < n; i++) {
    sum += (num[i] - k);
    res = max(sum, res);
    if (sum < 0) sum = 0;
  }
  return res;
}
double get_neg(double k) {
  double res = 1;
  double sum = 0;
  for (int i = 0; i < n; i++) {
    sum += (num[i] - k);
    res = min(sum, res);
    if (sum > 0) sum = 0;
  }
  return res;
}
double binary_search() {
  double l = -10005, r = 10005;
  while (r - l > EPS) {
    double mid = (l + r) / 2;
    if (get_posi(mid) + get_neg(mid) < 0) {
      r = mid;
    } else {
      l = mid;
    }
  }
  return get_posi(l);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf", &num[i]);
  }
  printf("%.8lf", binary_search());
}
