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 N = 2e5 + 7;
const int M = 4;
const int inf = 1e9 + 7;
const long long base = 1e18;
const double pi = acos(-1);
const double ep = 1e-9;
int n;
int a[N];
double F[N];
double f(double x) {
  F[0] = 0;
  double mn = 0, mx = 0;
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    F[i] = F[i - 1] + a[i] - x;
    ans = max(ans, max(abs(F[i] - mn), abs(F[i] - mx)));
    mn = min(mn, F[i]);
    mx = max(mx, F[i]);
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = (int)1; i < (int)n + 1; i++) scanf("%d", a + i);
  double lo = -10000, hi = 10000, g, res;
  for (int t = (int)0; t < (int)100; t++) {
    double g1 = (2 * lo + hi) / 3;
    double g2 = (lo + 2 * hi) / 3;
    if (f(g1) < f(g2))
      hi = g2;
    else
      lo = g1;
  }
  printf("%.9lf", f(lo));
}
