#include <bits/stdc++.h>
using namespace std;
double a[200001];
int n;
double get(double x) {
  double sum = 0, mn = 0, mx = 0, ans2 = 0, ans1 = 0;
  for (int i = 1; i <= n; i++) {
    sum += a[i] - x;
    mn = min(sum, mn);
    mx = max(sum, mx);
    ans1 = max(ans1, sum - mn);
    ans2 = max(ans2, abs(sum - mx));
  }
  double ans = max(abs(ans1), abs(ans2));
  return ans;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  double l = -1000000000.0, r = 1000000000.0;
  for (double it = 1; it != 350; it++) {
    double m1 = l + (r - l) / 3.0;
    double m2 = r - (r - l) / 3.0;
    if (get(m1) > get(m2))
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(6) << max(abs(get(l)), abs(get(r)));
  return 0;
}
