#include <bits/stdc++.h>
using namespace std;
int a[200001];
int n;
double f(double x) {
  double sum = 0, min_sum = 0, max_sum = 0, res = -1e18;
  for (int i = 1; i <= n; i++) {
    sum += a[i] - x;
    res = max(res, fabs(sum - min_sum));
    res = max(res, fabs(sum - max_sum));
    min_sum = min(min_sum, sum);
    max_sum = max(max_sum, sum);
  }
  return res;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  double l = -1e5, r = 1e5;
  for (int i = 1; i <= 100; i++) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    if (f(m1) < f(m2))
      r = m2;
    else
      l = m1;
  }
  printf("%.10f", f(l));
}
