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;
inline int Get() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n;
double w[200005];
double mx[200005], mn[200005];
double ans = 1e16;
double cal(double x) {
  mx[0] = mn[0] = 0;
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    mx[i] = max(0.0, mx[i - 1]) + w[i] - x;
    mn[i] = min(0.0, mn[i - 1]) + w[i] - x;
    ans = max(ans, max(fabs(mx[i]), fabs(mn[i])));
  }
  return ans;
}
int main() {
  n = Get();
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &w[i]);
  }
  long double l = -10001, r = 10001, mid, rmid;
  while (l + 1e-13 < r) {
    mid = (l + r) / 2;
    rmid = (mid + r) / 2;
    double lx = cal(mid), rx = cal(rmid);
    if (lx + 1e-13 > rx) {
      ans = min(ans, rx);
      l = mid + 1e-13;
    } else {
      ans = min(ans, lx);
      r = rmid - 1e-13;
    }
  }
  printf("%.6lf", ans);
  return 0;
}
