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 main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<double> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  double l = 0, r = 10000, ans;
  while (r - l > 1e-10) {
    double m1 = l + (r - l) / 3, m2 = l + 2 * (r - l) / 3, rp1, rp2;
    vector<double> cur1, cur2;
    for (int i = 0; i < n; i++) {
      cur1.push_back(v[i] - m1);
      cur2.push_back(v[i] - m2);
    }
    double maxg, maxl, ming, minl;
    maxg = maxl = ming = minl = cur1[0];
    for (int i = 1; i < n; i++) {
      maxl = max(maxl + cur1[i], cur1[i]);
      maxg = max(maxg, maxl);
    }
    for (int i = 1; i < n; i++) {
      minl = min(minl + cur1[i], cur1[i]);
      ming = min(ming, minl);
    }
    rp1 = max(maxg, ming * -1);
    maxg = maxl = ming = minl = cur2[0];
    for (int i = 1; i < n; i++) {
      maxl = max(maxl + cur2[i], cur2[i]);
      maxg = max(maxg, maxl);
    }
    for (int i = 1; i < n; i++) {
      minl = min(minl + cur2[i], cur2[i]);
      ming = min(ming, minl);
    }
    rp2 = max(maxg, ming * -1);
    ans = min(rp1, rp2);
    if (rp1 > rp2)
      l = m1;
    else
      r = m2;
  }
  printf("%.8lf\n", ans);
  return 0;
}
