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 int maxn = 105;
const long long INF = 1e18;
vector<long double> a;
vector<long double> n_a;
vector<long double> tmp1, tmp2;
vector<long double> sums1, sums2;
int n;
long double f(long double x) {
  for (int i = 0; i < n; i++) {
    tmp1[i] = a[i] - x;
    tmp2[i] = -(a[i] - x);
  }
  sums1[0] = sums2[0] = 0;
  for (int i = 0; i < n; i++) {
    sums1[i + 1] = sums1[i] + tmp1[i];
    sums2[i + 1] = sums2[i] + tmp2[i];
  }
  long double ans1 = -INF;
  int pos = 0;
  for (int i = 0; i < n; i++) {
    ans1 = max(ans1, sums1[i + 1] - sums1[pos]);
    if (sums1[i + 1] < sums1[pos]) pos = i + 1;
  }
  long double ans2 = -INF;
  pos = 0;
  for (int i = 0; i < n; i++) {
    ans2 = max(ans2, sums2[i + 1] - sums2[pos]);
    if (sums2[i + 1] < sums2[pos]) pos = i + 1;
  }
  return max(ans1, ans2);
}
void solve() {
  cin >> n;
  tmp1.resize(n);
  tmp2.resize(n);
  sums1.resize(n + 1);
  sums2.resize(n + 1);
  a.resize(n);
  n_a.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    n_a[i] = -a[i];
  }
  long double l = -1e5, r = 1e5;
  for (int it = 0; it < 80; it++) {
    long double delta = (r - l) / 3;
    long double m1 = l + delta;
    long double m2 = r - delta;
    long double fm1 = f(m1);
    long double fm2 = f(m2);
    if (fm1 > fm2) {
      l = m1;
    } else {
      r = m2;
    }
  }
  cout << f(l) << endl;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  solve();
  return 0;
}
