#include <bits/stdc++.h>
using namespace std;
int n;
double a[200005];
double contisum() {
  double maxx = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    if (cur > -1e-8)
      cur += a[i];
    else
      cur = a[i];
    if (cur - maxx > 1e-8) maxx = cur;
  }
  return maxx;
}
double check(double x) {
  for (int i = 0; i < n; i++) a[i] -= x;
  double maxx1 = contisum();
  for (int i = 0; i < n; i++) a[i] = -a[i];
  double maxx2 = contisum();
  for (int i = 0; i < n; i++) a[i] = -a[i];
  for (int i = 0; i < n; i++) a[i] += x;
  if (maxx1 - maxx2 > 1e-8)
    return maxx1;
  else
    return maxx2;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
    double ans = 0x7fffffff;
    double l = -10000.0, r = 10000.0;
    for (int i = 0; i < 200; i++) {
      double mid = (l + r) / 2;
      double rmid = (mid + r) / 2;
      double temp1 = check(mid);
      double temp2 = check(rmid);
      if (temp1 - temp2 < 1e-8)
        r = rmid;
      else
        l = mid;
      ans = min(ans, min(temp1, temp2));
    }
    printf("%.12f\n", ans);
  }
  return 0;
}
