#include <bits/stdc++.h>
using namespace std;
int n, i;
int mn;
int a[400010];
double mx, sum, l, r, mid, mmid;
double d[400010];
double f(double x) {
  mx = 0;
  for (i = 1; i <= n; i++) d[i] = a[i] - x;
  if (d[1] >= 0)
    sum = d[1];
  else
    sum = 0;
  for (i = 2; i <= n; i++) {
    if (sum - mx > 1e-30) mx = sum;
    if (d[i] + sum >= 0) {
      sum += d[i];
      continue;
    }
    sum = 0;
  }
  if (sum - mx > 1e-30) mx = sum;
  for (i = 1; i <= n; i++) d[i] = x - a[i];
  if (d[1] >= 0)
    sum = d[1];
  else
    sum = 0;
  for (i = 2; i <= n; i++) {
    if (sum - mx > 1e-30) mx = sum;
    if (d[i] + sum >= 0) {
      sum += d[i];
      continue;
    }
    sum = 0;
  }
  if (sum - mx > 1e-30) mx = sum;
  return mx;
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    mn = max(mn, a[i]);
    mn = max(mn, -a[i]);
  }
  l = -mn;
  r = mn;
  while (l < r - 4e-12) {
    mid = (l + r) / 2;
    mmid = (mid + r) / 2;
    if (f(mid) <= f(mmid))
      r = mmid;
    else
      l = mid;
  }
  printf("%.7f", f(l));
  return 0;
}
