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 + 24;
int n;
double a[maxn];
double cal(double x) {
  double ans1 = 0.0, tmp1 = 0.0, ans2 = 0.0, tmp2 = 0.0;
  for (int i = 1; i <= n; ++i) {
    double k = a[i] - x;
    tmp1 = max(tmp1 + k, 0.0);
    tmp2 = max(tmp2 - k, 0.0);
    ans1 = max(ans1, tmp1);
    ans2 = max(ans2, tmp2);
  }
  return max(ans1, ans2);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lf", &a[i]);
  double eps = 1e-6 / n / 2 * 1.0;
  double l = -10000.0, r = 10000.0, m1 = 0.0, m2 = 0.0, ans = 0.0;
  while (r - l > eps) {
    m1 = l + (r - l) / 3.0;
    m2 = r - (r - l) / 3.0;
    if (cal(m1) >= cal(m2))
      l = ans = m1;
    else
      r = ans = m2;
  }
  printf("%.10lf\n", cal(ans));
}
