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 = 200000 + 10;
int n;
int a[N];
double C(double m) {
  double mn = 0, mx = 0, ret = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i] - m;
    ret = max(ret, max(abs(sum - mx), sum - mn));
    mn = min(mn, sum);
    mx = max(mx, sum);
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  double lb = -10005.0, ub = 10005.0;
  int t = 100;
  while (t--) {
    double m1 = (lb + lb + ub) / 3.0, m2 = (lb + ub + ub) / 3.0;
    if (C(m1) > C(m2))
      lb = m1;
    else
      ub = m2;
  }
  printf("%.10f\n", C(lb));
  return 0;
}
