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 int MOD = 1000000007;
const double eps = 1e-9;
const double PI = 2 * acos(0);
const int MAXN = 2e5 + 5;
int n, k, m, t;
long long a[MAXN];
int cnt[100];
long long res;
double get(double pos) {
  int i, j, u, v;
  double prea = 0., pred = 0.;
  double sum = 0.;
  double mxd = -1e10, mxa = -1e10;
  i = 1;
  while (i <= n) {
    if (a[i] > pos) {
      sum = a[i] - pos;
      while (i < n && a[i + 1] > pos) sum += a[i + 1] - pos, i++;
      if (sum + pred > mxd) mxd = sum + pred;
      pred += sum;
      prea -= sum;
      if (prea < 0.) prea = 0.;
    } else {
      sum = pos - a[i];
      while (i < n && a[i + 1] <= pos) sum += pos - a[i + 1], i++;
      if (sum + prea > mxa) mxa = sum + prea;
      prea += sum;
      pred -= sum;
      if (pred < 0.) pred = 0.;
    }
    i++;
  }
  return max(mxa, mxd);
}
int main() {
  int i, j, x, y, z, v, w;
  cin.sync_with_stdio(false);
  cin >> n;
  int mxa = 1000000009, mxd = -1000000009;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] > mxd) mxd = a[i];
    if (a[i] < mxa) mxa = a[i];
  }
  double pos = (mxd + mxa) / 2., step = (mxd - mxa) / 2;
  double t1, t2;
  for (i = 1; i < 100; i++) {
    t1 = get(pos + 0.00000001);
    t2 = get(pos - 0.00000001);
    if (t1 < t2)
      pos = pos + step;
    else
      pos = pos - step;
    step /= 2;
  }
  printf("%.12lf", t1);
  return 0;
}
