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 long long N = 1e6 + 1;
const long long M = 1e3;
const double EPS = 1e-8;
const long long INF = 2 * 1e9;
double a[N];
struct data {
  double sum, pref, suff, ans;
};
data t[N], t2[N];
data combine(data l, data r) {
  data res;
  res.sum = l.sum + r.sum;
  res.pref = max(l.pref, l.sum + r.pref);
  res.suff = max(r.suff, r.sum + l.suff);
  res.ans = max(max(l.ans, r.ans), l.suff + r.pref);
  return res;
}
data make_data(double val) {
  data res;
  res.sum = val;
  res.pref = res.suff = res.ans = max((double)0, val);
  return res;
}
void build(int v, int tl, int tr) {
  if (tl == tr)
    t[v] = make_data(a[tl]);
  else {
    int tm = (tl + tr) / 2;
    build(v * 2, tl, tm);
    build(v * 2 + 1, tm + 1, tr);
    t[v] = combine(t[v * 2], t[v * 2 + 1]);
  }
}
data combine2(data l, data r) {
  data res;
  res.sum = l.sum + r.sum;
  res.pref = min(l.pref, l.sum + r.pref);
  res.suff = min(r.suff, r.sum + l.suff);
  res.ans = min(min(l.ans, r.ans), l.suff + r.pref);
  return res;
}
data make_data2(double val) {
  data res;
  res.sum = val;
  res.pref = res.suff = res.ans = min((double)0, val);
  return res;
}
void build2(int v, int tl, int tr) {
  if (tl == tr)
    t2[v] = make_data2(a[tl]);
  else {
    int tm = (tl + tr) / 2;
    build2(v * 2, tl, tm);
    build2(v * 2 + 1, tm + 1, tr);
    t2[v] = combine2(t2[v * 2], t2[v * 2 + 1]);
  }
}
int main() {
  double st = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(time(NULL));
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  double answer = INF;
  double l = -10011, r = 10011;
  for (int i = 0; i < 100; i++) {
    double m1 = l + (r - l) / 3.0;
    double m2 = m1 + (r - l) / 3.0;
    for (int j = 0; j < n; j++) a[j] -= m1;
    build(1, 0, n - 1);
    build2(1, 0, n - 1);
    double cur = max(abs(t[1].ans), abs(t2[1].ans));
    for (int j = 0; j < n; j++) a[j] += m1 - m2;
    build(1, 0, n - 1);
    build2(1, 0, n - 1);
    double cur2 = max(abs(t[1].ans), abs(t2[1].ans));
    answer = min(min(cur, cur2), answer);
    for (int j = 0; j < n; j++) a[j] += m2;
    if (cur > cur2)
      l = m1;
    else
      r = m2;
    if (clock() - st > 1900) break;
  }
  cout << fixed << setprecision(12) << answer;
}
