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;
int n, a[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  double L = -20000, R = 20000;
  while (fabs(R - L) > 1e-9) {
    double mid = (L + R) / 2;
    double X = -3e9, Y = -3e9;
    double LX = 0, LY = 0;
    for (int i = 0; i < n; i++) {
      LX = (a[i] + mid) + max(LX, 0.0);
      X = max(X, LX);
      LY = (-a[i] - mid) + max(LY, 0.0);
      Y = max(Y, LY);
    }
    if (X < Y)
      L = mid;
    else
      R = mid;
  }
  double X = -3e9, Y = -3e9;
  double LX = 0, LY = 0;
  for (int i = 0; i < n; i++) {
    LX = (a[i] + L) + max(LX, 0.0);
    X = max(X, LX);
    LY = (-a[i] - L) + max(LY, 0.0);
    Y = max(Y, LY);
  }
  printf("%.15f\n", max(X, Y));
  return 0;
}
