#include <bits/stdc++.h>
using namespace std;
int const MAXN = 2e5 + 5;
double arr[MAXN], tmp[MAXN];
int n;
double f(int x) {
  double mx = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    cur += tmp[i];
    if (cur > mx) mx = cur;
    if (cur < 0) cur = 0;
  }
  return mx;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  double l = *min_element(arr, arr + n);
  double r = *max_element(arr, arr + n);
  double e = 1e-8, m, vp, vn;
  for (int i = 0; i < 100; i++) {
    m = (l + r) / 2;
    for (int i = 0; i < n; i++) tmp[i] = arr[i] - m;
    vp = f(m);
    for (int i = 0; i < n; i++) tmp[i] *= -1;
    vn = f(m);
    if (vp > vn)
      l = m;
    else
      r = m;
  }
  m = (l + r) / 2;
  for (int i = 0; i < n; i++) tmp[i] = arr[i] - m;
  vp = f(m);
  for (int i = 0; i < n; i++) tmp[i] *= -1;
  vn = f(m);
  cout << fixed << setprecision(6) << max(vp, vn) << '\n';
  return 0;
}
