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;
const int maxn = 200100;
const double inf = 1e15;
const double eps = 1e-10;
int n, a[maxn];
double dabs(double d) {
  if (d < 0)
    return d * -1;
  else
    return d;
}
double go(double k) {
  double mi = 0, ma = 0, cur = 0;
  double ans = 0;
  for (int i = 0; i < n; i++) {
    cur += a[i] - k;
    ans = max(ans, max(dabs(cur - mi), dabs(cur - ma)));
    mi = min(mi, cur);
    ma = max(ma, cur);
  }
  return ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  double lo = -20000, hi = 20000;
  while (hi - lo > eps) {
    double m1 = lo + (hi - lo) / 3, m2 = lo + 2 * (hi - lo) / 3;
    if (go(m1) < go(m2))
      hi = m2;
    else
      lo = m1;
  }
  cout << fixed << setprecision(10) << go(lo) << '\n';
}
