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;
double a[200005], ans;
int i, j, k, s, m, n;
inline double check(double o) {
  double ans1 = 0, ans2 = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    ans1 = ans1 + a[i] - o;
    ans2 = ans2 + a[i] - o;
    if (ans1 > 0) ans1 = 0;
    if (ans2 < 0) ans2 = 0;
    ans = max(ans, max(abs(ans1), abs(ans2)));
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%lf", &a[i]);
  ans = n * 10000.0;
  double l = -10000.0, r = 10000.0;
  while (l + 1e-12 <= r) {
    double mid = (r - l) / 3.0 + l, mid1 = r - (r - l) / 3.0;
    double gt = check(mid), gtw = check(mid1);
    if (gt < gtw) {
      ans = min(ans, gt);
      r = mid1 - 1e-12;
    } else {
      ans = min(ans, gtw);
      l = mid + 1e-12;
    }
  }
  printf("%.9lf", ans);
}
