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, arr2[200005];
long double ki, ka, mid, tmp, tmp2, ans, arr[200005];
long double kadane[200005], kadane2[200005];
long double cek(long double x) {
  long double ret = 0;
  kadane[0] = max((long double)0, arr[0] - x);
  kadane2[0] = min((long double)0, arr[0] - x);
  for (int i = 0; i < n; i++) {
    kadane[i] = max((long double)0, kadane[i - 1] + arr[i] - x);
    kadane2[i] = min((long double)0, kadane2[i - 1] + arr[i] - x);
    ret = max(ret, max(abs(kadane[i]), abs(kadane2[i])));
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr2[i]);
    arr[i] = arr2[i];
  }
  ki = -10000;
  ka = 10000;
  ans = 2000000000;
  while (fabs(ki - ka) >= 1e-11) {
    mid = (ki + ka) / 2;
    tmp = cek(mid);
    tmp2 = cek(mid + 1e-11);
    if (tmp < tmp2) {
      ans = min(ans, tmp);
      ka = mid;
    } else if (tmp > tmp2) {
      ans = min(ans, tmp2);
      ki = mid;
    }
  }
  printf("%.15Lf\n", ans);
}
