10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#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) mx = sum;
    if (d[i] + sum >= 0) {
      sum += d[i];
      continue;
    }
    sum = 0;
  }
  if (sum > mx) 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) mx = sum;
    if (d[i] + sum >= 0) {
      sum += d[i];
      continue;
    }
    sum = 0;
  }
  if (sum > mx) mx = sum;
  return mx;
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    mn = max(mn, a[i]);
    mn = max(mn, -a[i]);
  }
  l = -mn;
  r = mn;
  while (l < r - 1e-10) {
    mid = (l + r) / 2;
    mmid = (mid + r) / 2;
    if (f(mid) < f(mmid))
      r = mmid;
    else
      l = mid;
  }
  printf("%.7f", f(l));
  return 0;
}
