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 maxn = 200005;
const double eps = 1e-11;
int n;
double ori[maxn];
inline double max(const double& a, const double& b) { return a > b ? a : b; }
double cal(double mid) {
  double ret = -9;
  double now1 = 0, now2 = 0;
  double sum = 0;
  double temp;
  for (int i = 1; i <= n; i++) {
    sum += (ori[i] - mid);
    ret = max(ret, fabs(sum - now1));
    ret = max(ret, fabs(sum - now2));
    now1 = max(now1, sum);
    now2 = min(now2, sum);
  }
  return ret;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%lf", ori + i);
    double l = -1e4 - 5, r = 1e4 + 5;
    double ans;
    while (r - l >= eps) {
      double mid = l + (r - l) / 3.0;
      double midmid = r - (r - l) / 3.0;
      double mid_ans = cal(mid);
      double midmid_ans = cal(midmid);
      ans = max(mid_ans, midmid_ans);
      if (mid_ans <= midmid_ans)
        r = midmid;
      else
        l = mid;
    }
    printf("%.10lf\n", ans);
  }
}
