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 MAXN = 200100, MAXA = 10000, MAG = 100;
int n, a[MAXN];
bool fik(long double z) {
  int zn = -1, tc = -1;
  long double mx = -1, ts = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] - z < 0) {
      if (tc == -1) {
        ts -= a[i] - z;
      } else {
        if (mx < ts) {
          mx = ts;
          zn = tc;
        }
        tc = -1;
        ts = -(a[i] - z);
      }
    } else {
      if (tc == 1) {
        ts += a[i] - z;
      } else {
        if (mx < ts) {
          mx = ts;
          zn = tc;
        }
        tc = 1;
        ts = a[i] - z;
      }
    }
  }
  if (mx < ts) {
    mx = ts;
    zn = tc;
  }
  if (zn == -1) return true;
  return false;
}
long double an(long double z) {
  int zn = -1, tc = -1;
  long double mx = -1, ts = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] - z < 0) {
      if (tc == -1) {
        ts -= a[i] - z;
      } else {
        if (mx < ts) {
          mx = ts;
          zn = tc;
        }
        tc = -1;
        ts = -(a[i] - z);
      }
    } else {
      if (tc == 1) {
        ts += a[i] - z;
      } else {
        if (mx < ts) {
          mx = ts;
          zn = tc;
        }
        tc = 1;
        ts = a[i] - z;
      }
    }
  }
  if (mx < ts) {
    mx = ts;
    zn = tc;
  }
  return mx;
}
long double fid() {
  long double l = 0, r = MAXA * 2, m;
  for (int it = 0; it < MAG; it++) {
    m = (r + l) / 2;
    if (fik(m))
      r = m;
    else
      l = m;
  }
  return l;
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(20);
  cin >> n;
  int mn = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mn = min(mn, a[i]);
  }
  if (mn < 0) {
    mn = -mn;
  } else {
    mn = -1;
  }
  for (int i = 0; i < n; i++) {
    a[i] += mn + 1;
  }
  cout << an(fid());
  return 0;
}
