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 = 200000 + 10;
double a[MAXN];
double dp[MAXN];
double f[MAXN];
int n;
double cal(double x) {
  double res = 0;
  f[1] = dp[1] = a[1] - x;
  res = fabs(dp[1]);
  for (int i = 2; i <= n; i++) {
    double tmp = a[i] - x;
    dp[i] = max(tmp, dp[i - 1] + tmp);
    f[i] = min(tmp, tmp + f[i - 1]);
    res = max(res, fabs(dp[i]));
    res = max(res, fabs(f[i]));
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", a + i);
  double L = -MAXN, R = MAXN;
  for (int i = 1; i <= 300; i++) {
    double m1 = L + (R - L) / 3;
    double m2 = R - (R - L) / 2;
    if (cal(m1) < cal(m2)) {
      R = m2;
    } else {
      L = m1;
    }
  }
  printf("%.12f\n", cal(L));
}
