#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
inline void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
inline void smax(P &a, Q b) {
  if (a < b) a = b;
}
const int maxn = 200000 + 100;
int n;
int a[maxn], s[maxn];
double f(double x) {
  double mn = 0, mx = 0;
  for (int i = 0, _n = (int)(n + 1); i < _n; i++)
    smin(mn, s[i] - i * x), smax(mx, s[i] - i * x);
  return mx - mn;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0, _n = (int)(n); i < _n; i++) cin >> a[i];
  for (int i = 0, _n = (int)(n); i < _n; i++) s[i + 1] = s[i] + a[i];
  double lo = -1e5, hi = 1e5;
  for (int z = 0, _n = (int)(100); z < _n; z++) {
    double m1 = (2 * lo + hi) / 3;
    double m2 = (lo + 2 * hi) / 3;
    if (f(m1) < f(m2))
      hi = m2;
    else
      lo = m1;
  }
  cout.setf(ios::fixed);
  cout.precision(9);
  cout << f(lo) << '\n';
  return 0;
}
