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 = 3e-12;
const int N = (int)2e6 + 10;
double a[N], b[N];
int n;
double maxSum(double a[]) {
  double ans = 0, tmp = 0;
  for (int i = 0; i < n; i++) {
    tmp += a[i];
    if (tmp < 0) tmp = 0;
    ans = max(ans, tmp);
  }
  return ans;
}
double calc(double x) {
  for (int i = 0; i < n; i++) b[i] = a[i] - x;
  double ans1 = maxSum(b);
  for (int i = 0; i < n; i++) b[i] *= -1;
  double ans2 = maxSum(b);
  return max(ans1, ans2);
}
double Search() {
  double left = -1e4, right = 1e4;
  double midl, midr;
  while (right - left > eps) {
    midl = (2 * left + right) / 3.0;
    midr = (left + 2 * right) / 3.0;
    double w1 = calc(midl);
    double w2 = calc(midr);
    if (w1 < w2)
      right = midr;
    else
      left = midl;
  }
  return calc(right);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  printf("%.15f\n", Search());
  return 0;
}
