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;
int n;
double a[200090];
double eps = 5e-12;
double cal(double x) {
  double sum = 0, MAX = 0, MIN = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i] - x;
    MAX = max(MAX, sum);
    MIN = min(MIN, sum);
  }
  return MAX - MIN;
}
int main(int argc, char* argv[]) {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  double left = -20000, right = 20000;
  while (right - left > eps) {
    double L = (left * 2 + right) / 3, R = (left + right * 2) / 3;
    if (cal(L) > cal(R))
      left = L;
    else
      right = R;
  }
  printf("%.15lf\n", cal(left));
  return 0;
}
