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 iinf = 0x7fffffff;
const long long linf = ~(1LL << 63);
const int maxn = 2e5 + 5;
int n;
double a[maxn];
double b[maxn];
double max_con_seq(double* seq, int len) {
  double ans = -linf;
  double now = 0;
  for (int i = 0; i < len; i++) {
    now += seq[i];
    if (ans < now) ans = now;
    if (now < 0) now = 0;
  }
  return ans;
}
double wrapper(double x) {
  double ans = -linf;
  for (int i = 0; i < n; i++) b[i] = a[i] - x;
  ans = max_con_seq(b, n);
  for (int i = 0; i < n; i++) b[i] = x - a[i];
  ans = max(ans, max_con_seq(b, n));
  return ans;
}
void read() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
}
void solve() {
  double l = -20050, r = 20050;
  double ans = wrapper((l + r) / 2);
  double last_ans = -linf;
  while (fabs(l - r) > 1e-11) {
    double lm = (r + 2 * l) / 3;
    double rm = (2 * r + l) / 3;
    double lv = wrapper(lm), rv = wrapper(rm);
    last_ans = ans;
    if (lv <= rv) {
      r = rm;
      ans = lv;
    } else {
      l = lm;
      ans = rv;
    }
  }
  cout << fixed << setprecision(10) << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  read();
  solve();
  return 0;
}
