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 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;
  while ((r - l) > e) {
    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;
}
