#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;
}
