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;
long long int modpow(long long int a, long long int n, long long int temp) {
  long long int res = 1, y = a;
  while (n > 0) {
    if (n & 1) res = (res * y) % temp;
    y = (y * y) % temp;
    n /= 2;
  }
  return res % temp;
}
vector<double> c;
double mcs(vector<int> &a, double x) {
  int i;
  for (i = 0; i < c.size(); ++i) c[i] = a[i] - x;
  double sum = 0, res = 0;
  for (i = 0; i < c.size(); ++i) {
    sum += c[i];
    if (sum < 0) sum = 0;
    res = max(res, sum);
  }
  return res;
}
int main() {
  int n, i;
  cin >> n;
  c = vector<double>(n);
  vector<int> a(n), b(n);
  for (i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = -a[i];
  }
  double l = *min_element(a.begin(), a.end()),
         r = *max_element(a.begin(), a.end());
  while (fabs(l - r) > .0000001) {
    double m = (l + r) / 2;
    double pos = mcs(a, m);
    double neg = mcs(b, -m);
    if (pos > neg) {
      l = m;
    } else {
      r = m;
    }
  }
  float m = (l + r) / 2;
  printf("%.7lf", max(mcs(a, m), mcs(b, -m)));
  return 0;
}
