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 n;
vector<double> a, p;
double poor(double x) {
  p[1] = a[1] - x;
  for (long long i = 2; i <= n; i++) p[i] = p[i - 1] + a[i] - x;
  long long m1 = 0;
  long long m2 = 0;
  double mn = p[1];
  double mx = p[1];
  for (long long i = 1; i <= n; i++) {
    mx = max(mx, p[i] - p[m1]);
    mn = min(mn, p[i] - p[m2]);
    if (p[i] < p[m1]) m1 = i;
    if (p[i] > p[m2]) m2 = i;
  }
  return max(abs(mx), abs(mn));
}
signed main() {
  cin >> n;
  a.resize(n + 1);
  p.resize(n + 1);
  for (long long i = 1; i <= n; i++) cin >> a[i];
  double l = -10000, r = 10000;
  for (long long i = 0; i < 300; i++) {
    double left = l + (r - l) / 3;
    double right = l + 2 * (r - l) / 3;
    if (poor(left) < poor(right))
      r = right;
    else
      l = left;
  }
  cout << fixed << setprecision(10) << poor(l);
  return 0;
}
