#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-16;
const long long inf = 1000000010;
const int mod = 1000 * 1000 * 1000;
const int MAXN = 1000010;
int n, m, d, x;
long double A[MAXN];
long double calc(long double x) {
  long double mn = 0, mx = 0, tmp = 0;
  for (int i = 0; i < n; i++) {
    tmp += A[i] - x;
    mn = min(mn, tmp);
    mx = max(mx, tmp);
  }
  return mx - mn;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  long double l = -inf, r = inf;
  for (int i = 0; i < 200; i++) {
    long double m1 = (2 * l + 1 * r) / 3;
    long double m2 = (1 * l + 2 * r) / 3;
    if (calc(m1) < calc(m2))
      r = m2;
    else
      l = m1;
  }
  cout << setprecision(20) << fixed << calc(l) << endl;
  return 0;
}
