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;
vector<int> a;
int n;
long double f(long double x) {
  vector<long double> b(n);
  for (int i = 0; i < n; i++) b[i] = 1.0 * a[i] - x;
  long double mx = 0.0, sum1 = 0.0;
  for (int i = 0; i < n; i++) {
    sum1 = max(b[i], sum1 + b[i]);
    mx = max(mx, sum1);
  }
  long double mn = 0.0, sum2 = 0.0;
  for (int i = 0; i < n; i++) {
    sum2 = min(b[i], sum2 + b[i]);
    mn = min(mn, sum2);
  }
  return max(fabs(mn), fabs(mx));
}
int main() {
  scanf("%d", &n);
  a.resize(n);
  for (int &i : a) scanf("%d", &i);
  long double L = -1e9, R = 1e9;
  while (R - L > 1e-10) {
    long double delta = (R - L) / 3.0;
    long double m1 = L + delta;
    long double m2 = R - delta;
    f(m1) < f(m2) ? R = m2 : L = m1;
  }
  printf("%.10Lf", f(R));
}
