10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#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;
}
