#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long double solve(vector<long long>& v, long double x) {
  long double mn = 0;
  long double mx = 0;
  long double ans = 0;
  for (int i = 0; i < (int)v.size(); ++i) {
    long double cur = 1.0 * v[i] - x * (i + 1);
    ans = max(ans, abs(cur - mx));
    ans = max(ans, abs(cur - mn));
    mx = max(mx, cur);
    mn = min(mn, cur);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < (n); ++i) {
    scanf("%lld", &v[i]);
    if (i) v[i] += v[i - 1];
  }
  long double l = -3e4, r = +3e4, mid1, mid2;
  int iter = 100;
  while (iter--) {
    mid1 = (r - l) / 3.0;
    mid2 = r - mid1;
    mid1 += l;
    long double v1 = solve(v, mid1);
    long double v2 = solve(v, mid2);
    if (v1 < v2) {
      r = mid2;
    } else
      l = mid1;
  }
  mid1 = solve(v, (mid1 + mid2) / 2);
  printf("%.15lf\n", (double)mid1);
  return 0;
}
