#include <bits/stdc++.h>
using namespace std;
double weakness(vector<int> &v, double x) {
  double smin = 0, smax = 0, best = 0, cur;
  for (int i = 0; i < v.size(); i++) {
    cur = v[i] - x;
    smin = min(cur, smin + cur);
    smax = max(cur, smax + cur);
    best = max({best, abs(smax), abs(smin)});
  }
  return best;
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  double l = -10000, r = 10000;
  for (int i = 0; i < 60; i++) {
    double m = (l + r) / 2;
    if (weakness(v, m) >= weakness(v, m + 1e-12))
      l = m;
    else
      r = m;
  }
  printf("%.9lf\n", weakness(v, l));
}
