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 n;
vector<int> v(2 * 100000);
vector<double> vv(2 * 100000);
inline void calc(int l, double m, double &p, double &n) {
  int x;
  for (x = 0; x < l; x++) vv[x] = v[x] * 1.0 - m;
  double mx = 0, sm = 0;
  for (x = 0; x < l; x++) {
    sm += vv[x];
    if (sm > mx) mx = sm;
    if (sm < 0) sm = 0;
  }
  p = mx;
  for (x = 0; x < l; x++) vv[x] = -vv[x];
  mx = sm = 0;
  for (x = 0; x < l; x++) {
    sm += vv[x];
    if (sm > mx) mx = sm;
    if (sm < 0) sm = 0;
  }
  n = mx;
}
int main() {
  scanf("%d", &n);
  ;
  int x;
  for (x = 0; x < n; x++) scanf("%d", &v[x]);
  ;
  double l = *min_element(v.begin(), v.begin() + n);
  double r = *max_element(v.begin(), v.begin() + n);
  double eps = 1e-6;
  double ans;
  for (x = 1; x <= 100; x++) {
    double m = (l + r) / 2.0;
    double pos, neg;
    calc(n, m, pos, neg);
    if (pos > neg)
      l = m;
    else if (pos < neg)
      r = m;
    else if (abs(pos - neg) == eps) {
      ans = pos;
      break;
    }
  }
  printf("%.7lf", ans);
}
