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 long long N = 2e5 + 10;
const double eps = 1e-9;
double a[N];
double b[N];
long long n;
double fun(double x) {
  for (long long i = 0; i < n; i++) b[i] = a[i] - x;
  double mx = 0;
  double mn = 0;
  double cur = 0;
  double res = 0;
  for (long long i = 0; i < n; i++) {
    cur += b[i];
    res = max(res, abs(cur - mx));
    res = max(res, abs(cur - mn));
    mx = max(mx, cur);
    mn = min(mn, cur);
  }
  return res;
}
void solve() {
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  double l = -1e4;
  double r = 1e4;
  for (long long i = 0; i < 40; i++) {
    double mid = (l + r) / 2;
    if (fun(mid - eps) < fun(mid))
      r = mid;
    else
      l = mid;
  }
  cout << fixed << setprecision(6) << fun(l);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
}
