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;
long long a[N];
double fuck(double x) {
  int i;
  double s1, s2;
  double ans = 0;
  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, m;
  cin >> n;
  l = -1e4;
  r = 1e4;
  for (i = 0; i < n; i++) scanf("%I64d", a + i);
  while (l < r - 1.0) {
    double l1 = fuck(l + (r - l) / 3), r1 = fuck(r - (r - l) / 3);
    if (l1 > r1)
      l = l + (r - l) / 3;
    else
      r = r - (r - l) / 3;
  }
  double j = floor(l) - 2.0, ans = fuck(l);
  for (; j <= floor(l) + 2.0; j += 0.5) ans = min(ans, fuck(j));
  printf("%.10lf", ans);
  return 0;
}
