#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000;
double a[MAXN];
int N;
bool increasing(double x, double& maxsum) {
  double last_maxp, last_maxn, maxp, maxn;
  last_maxp = last_maxn = maxp = maxn = 1e-18;
  for (int i = 0; i <= N - 1; ++i) {
    last_maxp = max(last_maxp + a[i] - x, a[i] - x);
    maxp = max(maxp, last_maxp);
    last_maxn = max(last_maxn + x - a[i], x - a[i]);
    maxn = max(maxn, last_maxn);
  }
  maxsum = max(maxn, maxp);
  return maxn > maxp;
}
int main() {
  cin >> N;
  for (int i = 0; i <= N - 1; ++i) cin >> a[i];
  double l = -1e4, r = 1e4;
  double ans;
  for (int _ = 1; _ <= 100; ++_) {
    double m = (l + r) * 0.5;
    if (increasing(m, ans))
      r = m;
    else
      l = m;
  }
  cout << setprecision(20) << fixed << ans << '\n';
  return 0;
}
