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 a[200006], n;
double kadane(vector<double> v) {
  double res = (-1.0) * 1e18;
  double temp = 0;
  for (int i = 0; i < v.size(); i++) {
    temp += v[i];
    res = max(res, temp);
    temp = max(0.0, temp);
  }
  return res;
}
double cal(double x) {
  vector<double> pos, neg;
  for (int i = 1; i <= n; i++) {
    pos.push_back(x - (double)a[i]);
    neg.push_back((double)a[i] - x);
  }
  double res1, res2;
  res1 = kadane(pos);
  res2 = kadane(neg);
  return max(res1, res2);
}
double ternary_search(double l, double r) {
  double eps = 1e-9;
  while (r - l > eps) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    double f1 = cal(m1);
    double f2 = cal(m2);
    if (f1 > f2)
      l = m1;
    else
      r = m2;
  }
  return cal(l);
}
int main(int argc, char const *argv[]) {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  cout << ternary_search(-10000.0, 10000.0) << endl;
  return 0;
}
