#include <bits/stdc++.h>
using namespace std;
double a[200011];
int n;
double check(double x) {
  for (int i = 1; i <= n; i++) {
    a[i] -= x;
  }
  double mi = min(0.0, a[1]);
  double ans = 0;
  double ma = max(0.0, a[1]);
  double cur = 0;
  for (int i = 1; i <= n; i++) {
    cur += a[i];
    mi = min(mi, cur);
    ma = max(ma, cur);
    ans = max(ans, cur);
    ans = max(ans, fabs(cur - mi));
    ans = max(ans, fabs(cur - ma));
  }
  for (int i = 1; i <= n; i++) {
    a[i] += x;
  }
  return ans;
}
int main() {
  double lo = 0;
  double hi = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    hi = max(hi, abs(a[i]));
  }
  lo = -hi;
  double mid;
  double m1, m2, v1, v2;
  for (int g = 0; g <= 200; g++) {
    m1 = lo + (hi - lo) / 3;
    m2 = lo + 2 * (hi - lo) / 3;
    v1 = check(m1);
    v2 = check(m2);
    if (v1 > v2) {
      lo = m1;
    } else if (v1 < v2) {
      hi = m2;
    } else {
      lo = m1;
      hi = m2;
    }
  }
  printf("%.10f", check(lo));
}
