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 + 1;
int n;
double a[N];
double fuck(double x) {
  int i;
  double s1, s2, ans;
  ans = s1 = s2 = 0.0;
  for (i = 0; i < n; i++) {
    s1 += a[i] - x;
    s2 += a[i] - x;
    s1 = max(s1, 0.0);
    s2 = min(s2, 0.0);
    ans = max(ans, s1);
    ans = max(ans, fabs(s2));
  }
  return ans;
}
int main() {
  int i;
  double l, r;
  cin >> n;
  l = -2e4;
  r = 2e4;
  for (i = 0; i < n; i++) scanf("%lf", a + i);
  while (l < r - 1e-6) {
    double l1 = fuck(l + (r - l) / 3.0), r1 = fuck(r - (r - l) / 3.0);
    if (l1 > r1)
      l = l + (r - l) / 3.0;
    else
      r = r - (r - l) / 3.0;
  }
  printf("%.20lf", fuck(l));
  return 0;
}
