#include <bits/stdc++.h>
using namespace std;
int n, a[200001];
const double esl = 1e-11;
double cal(double x) {
  double t = 0;
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    if (t + a[i] - x < 0) {
      ans = max(ans, t);
      t = 0;
    } else {
      t += ((double)a[i] - x);
      ans = max(ans, t);
    }
  }
  ans = max(ans, t);
  double t1 = 0;
  for (int i = 1; i <= n; i++) {
    if (t1 + a[i] - x > 0) {
      ans = max(ans, -t1);
      t1 = 0;
    } else {
      t1 += ((double)a[i] - x);
      ans = max(ans, -t1);
    }
  }
  ans = max(ans, -t1);
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  double l = -(1e5);
  double r = 1e5;
  for (int i = 1; i <= 500; i++) {
    double d = (2.0 * l + r) / 3;
    double c = (2.0 * r + l) / 3;
    if (cal(d) > cal(c)) {
      l = d;
    } else
      r = c;
  }
  printf("%.10f", cal(l));
  return 0;
}
