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