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;
void debug_out() { cerr << '\n'; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
const int maxn = 2e5 + 10;
long long n;
long long a[maxn];
long double f(long double x) { return x > 0 ? x : -x; }
int main(void) {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  long double st = -1e9, ed = 1e9;
  long double opt = 1e16;
  for (int r = 0; r < 500; ++r) {
    if (st > ed) swap(st, ed);
    long double mid = (st + ed) / 2;
    long double mn = 1e18, mx = -1e18, mnsum = 0, mxsum = 0;
    for (int i = 1; i <= n; ++i) {
      mnsum += a[i] - mid;
      mxsum += a[i] - mid;
      mn = min(mn, mnsum);
      mx = max(mx, mxsum);
      mnsum = min<long double>(mnsum, 0);
      mxsum = max<long double>(mxsum, 0);
    }
    if (f(mn) < f(mx)) {
      st = mid;
      opt = min(opt, f(mx));
    } else {
      ed = mid;
      opt = min(opt, f(mn));
    }
  }
  cout.precision(10);
  cout << fixed;
  cout << opt;
  return 0;
}
