#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-11;
const int maxn = 200000 + 100;
int a[maxn];
double l[maxn];
int n;
double cal(double x) {
  double sum = 0;
  for (int i = 0; i < n; i++) l[i] = a[i] * 1.0 - x;
  double cur = 0;
  for (int i = 0; i < n; i++) {
    cur = cur + l[i];
    if (cur < 0) cur = 0;
    sum = max(sum, cur);
    l[i] = -l[i];
  }
  cur = 0;
  for (int i = 0; i < n; i++) {
    cur = cur + l[i];
    if (cur < 0) cur = 0;
    sum = max(sum, cur);
  }
  return sum;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  double l = -1e4, r = 1e4, m1, m2, v1, v2;
  int t = 100;
  while (t--) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    v1 = cal(m1);
    v2 = cal(m2);
    if (v1 > v2)
      l = m1;
    else
      r = m2;
  }
  printf("%.15f\n", cal(l));
  return 0;
}
