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;
int n;
vector<int> aa;
vector<double> a, b;
double mabs(double x) {
  if (x < 0)
    return (-1.0 * x);
  else
    return x;
}
double weak_ma(double x);
double weak_mi(double x);
bool check(double t);
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  aa.resize(n);
  a.resize(n);
  b.resize(n);
  for (int i = 0; i < n; ++i) cin >> aa[i];
  for (int i = 0; i < n; ++i) a[i] = double(aa[i]);
  sort(aa.begin(), aa.end());
  if (aa[0] == aa[n - 1]) {
    cout << fixed << setprecision(8) << 0.0 << endl;
    return 0;
  }
  double l = 0.0;
  double r = 4000111222.0;
  if (weak_ma(0.0) <= 0 || weak_ma(0.0) < (-1.0 * weak_mi(0.0))) {
    for (int i = 0; i < n; ++i) a[i] *= -1.0;
  }
  for (int it = 0; it < 40; ++it) {
    double mid = (l + r) / 2.0;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  cout << fixed << setprecision(8) << r << endl;
  return 0;
}
bool check(double t) {
  double mi = weak_mi(0.0);
  double ma = weak_ma(0.0);
  if (mabs(ma) <= t) return true;
  double l = 0.0;
  double r = mabs(ma) + t + 1.0;
  while (r - l > 3e-7) {
    double mid = (l + r) / 2.0;
    if (mabs(weak_mi(mid)) > t + 1e-7)
      r = mid;
    else
      l = mid;
  }
  return (mabs(weak_ma(l)) <= t + 1e-7);
}
double weak_ma(double x) {
  for (int i = 0; i < n; ++i) b[i] = a[i] - x;
  for (int i = 1; i < n; ++i) b[i] += b[i - 1];
  double res = -4000111222.0;
  double mmi = 0.0;
  for (int i = 0; i < n; ++i) {
    if (b[i] - mmi > res) res = b[i] - mmi;
    if (b[i] < mmi) mmi = b[i];
  }
  return res;
}
double weak_mi(double x) {
  for (int i = 0; i < n; ++i) b[i] = a[i] - x;
  for (int i = 1; i < n; ++i) b[i] += b[i - 1];
  double res = 4000111222.0;
  double mma = 0.0;
  for (int i = 0; i < n; ++i) {
    if (b[i] - mma < res) res = b[i] - mma;
    if (b[i] > mma) mma = b[i];
  }
  return res;
}
