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 = 200200;
int a[N];
int n, m, i, j, k;
double l, r, f1, f2, u, v;
double solve(double c) {
  int i;
  double sum, ans, l, r;
  ans = sum = l = r = 0;
  for (i = 1; i <= n; i++) {
    sum += a[i] - c;
    l = min(l, sum);
    r = max(r, sum);
    ans = max(ans, fabs(sum - l));
    ans = max(ans, fabs(sum - r));
    ans = max(ans, sum);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  l = -1e5;
  r = 1e5;
  while (fabs(r - l) >= 1e-8) {
    u = l + (r - l) / 3;
    v = l + (r - l) / 3 * 2;
    f1 = solve(u);
    f2 = solve(v);
    if (f1 <= f2)
      r = v;
    else
      l = u;
  }
  printf("%.7lf\n", solve(l));
  return 0;
}
