#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n;
int a[N];
double maxSuff[N];
double minSuff[N];
double mx[N], mn[N];
double f(double x) {
  double tmp;
  for (int i = 1; i <= n; i++) {
    tmp = a[i] - x;
    mx[i] = mn[i] = maxSuff[i] = minSuff[i] = 0;
    maxSuff[i] = max(0.0, maxSuff[i - 1] + tmp);
    minSuff[i] = min(0.0, minSuff[i - 1] + tmp);
    mx[i] = max(mx[i - 1], maxSuff[i - 1] + tmp);
    mn[i] = min(mn[i - 1], minSuff[i - 1] + tmp);
  }
  return max(abs(mx[n]), abs(mn[n]));
}
double tsearch(double l, double r) {
  double a, b;
  for (int i = 0; i < 500; i++) {
    a = l + (r - l) / 3;
    b = r - (r - l) / 3;
    if (f(a) < f(b)) {
      r = b;
    } else {
      l = a;
    }
  }
  return (r + l) / 2;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  printf("%.8lf\n", f(tsearch(-2e9 - 9, 2e9 + 7)));
  return 0;
}
