#include <bits/stdc++.h>
using namespace std;
void fio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
double solve(double mid, vector<double> vec, double n) {
  for (int i = 0; i < n; i++) {
    vec[i] = vec[i] - mid;
  }
  double cur_sum = vec[0], max_sum = vec[0];
  double cur_min = vec[0], min_sum = vec[0];
  for (int i = 1; i < n; i++) {
    cur_sum = max(cur_sum + vec[i], vec[i]);
    max_sum = max(max_sum, cur_sum);
    cur_min = min(cur_min + vec[i], vec[i]);
    min_sum = min(cur_min, min_sum);
  }
  return max(max_sum, abs(min_sum));
}
int main() {
  fio();
  cout << fixed << setprecision(14);
  double n;
  cin >> n;
  vector<double> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  double l = -(1e4 + 7), r = 1e4 + 7;
  for (int i = 0; i < 300; i++) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    double f1 = solve(m1, vec, n);
    double f2 = solve(m2, vec, n);
    if (f1 < f2)
      r = m2;
    else
      l = m1;
  }
  double mid = r;
  for (int i = 0; i < n; i++) {
    vec[i] = vec[i] - mid;
  }
  double cur_sum = vec[0], max_sum = vec[0];
  double cur_min = vec[0], min_sum = vec[0];
  for (int i = 1; i < n; i++) {
    cur_sum = max(cur_sum + vec[i], vec[i]);
    max_sum = max(max_sum, cur_sum);
    cur_min = min(cur_min + vec[i], vec[i]);
    min_sum = min(cur_min, min_sum);
  }
  cout << max(max_sum, abs(min_sum)) << endl;
  return 0;
}
