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;
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << h;
  if (sizeof...(t)) {
    cerr << ", ";
  }
  DBG(t...);
}
int n;
double a[200005];
const double eps = 5e-10;
inline double weakness(double x) {
  double s1 = 0, s2 = 0;
  double mx = 0;
  for (int i = 0; i < n; i++) {
    double temp = a[i] - x;
    s1 += temp;
    if (s1 < 0) s1 = 0;
    s2 += temp;
    if (s2 > 0) s2 = 0;
    mx = max(mx, max(s1, -s2));
  }
  return mx;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  double l = -10001.0, r = 10001.0;
  while (r - l > eps) {
    double lm = (l * 2 + r) / 3;
    double rm = (l + r * 2) / 3;
    if (weakness(lm) > weakness(rm))
      l = lm;
    else
      r = rm;
  }
  printf("%.10lf", weakness(l));
  return 0;
}
