#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const long long mod = 1000000007;
const long long maxn = 200005;
const double epsilon = 1e-11;
double a[maxn], mn, mp;
long long n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(12) << fixed;
  while (cin >> n) {
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    long long t = 100;
    double low = *(std::min_element(a, a + n));
    double high = *(std::max_element(a, a + n));
    double mid;
    while (t--) {
      mid = (low + high) / 2.0;
      mn = mod, mp = -mod;
      double cn = 0, cp = 0, tmp;
      for (int i = 0; i < n; ++i) {
        tmp = a[i] - mid;
        cp = max(cp + tmp, tmp);
        cn = min(cn + tmp, tmp);
        mp = max(cp, mp);
        mn = min(cn, mn);
      }
      if (mn + mp > 0) {
        low = mid;
      } else {
        high = mid;
      }
    }
    mn = mod, mp = -mod;
    double cn = 0, cp = 0, tmp;
    for (int i = 0; i < n; ++i) {
      tmp = a[i] - mid;
      cp = max(cp + tmp, tmp);
      cn = min(cn + tmp, tmp);
      mp = max(cp, mp);
      mn = min(cn, mn);
    }
    cout << max(mp, -mn) << "\n";
  }
  return 0;
}
