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 mod = 1e9 + 7;
const double oo = 1e5 + 1;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<double> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  auto f = [&](double x) {
    double Max = 0, Min = 0, cur = 0, ans = 0;
    for (long long i = 0; i < n; i++) {
      cur += a[i] - x;
      ans = max(ans, abs(cur - Min));
      ans = max(ans, abs(cur - Max));
      Min = min(Min, cur);
      Max = max(Max, cur);
    }
    return ans;
  };
  double l = -1e4, r = 1e4;
  for (long long i = 1; i <= 300; i++) {
    double mid1 = l + (r - l) / 3;
    double mid2 = r - (r - l) / 3;
    if (f(mid1) < f(mid2))
      r = mid2;
    else
      l = mid1;
  }
  cout << fixed << setprecision(10) << f(l);
}
