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<long double> cum, cumt;
long double weakness() {
  long double mx = 0, mxc = 0, mn = INT_MAX, mnc = INT_MAX;
  mx = mxc = cum[0];
  for (int i = 1; i < n; i++) {
    mxc = max(cum[i], mxc + cum[i]);
    mx = max(mx, mxc);
  }
  mn = mnc = cum[0];
  for (int i = 1; i < n; i++) {
    mnc = min(cum[i], mnc + cum[i]);
    mn = min(mn, mnc);
  }
  return max(abs(mx), abs(mn));
}
long double calc(long double x) {
  for (double i = 0; i < n; i++) cum[i] = cumt[i] - x;
  return weakness();
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  cum.resize(n), cumt.resize(n);
  for (int i = 0; i < n; i++) cin >> cum[i];
  cumt = cum;
  long double a = -10000, d = 10000, b = (2 * a + d) / 3, c = (a + 2 * d) / 3;
  while (c - b > 0.000000000001) {
    if (calc(b) > calc(c))
      a = b;
    else
      d = c;
    b = (2 * a + d) / 3, c = (a + 2 * d) / 3;
  }
  cout << fixed << setprecision(7) << calc(b) << endl;
  cin.ignore(), cin.get();
}
