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;
long double eps = 1e-11;
long double l, r, mid;
int n, i, mi, mx, a[200020];
long double fff(long double x) {
  long double ttt1 = 0, ttt2 = 0;
  long double ans1 = 0, ans2 = 0;
  int i;
  for (i = 1; i <= n; i++) {
    if (ttt1 + a[i] - x > 0) {
      ttt1 += a[i] - x;
      ans1 = max(ans1, ttt1);
    } else
      ttt1 = 0;
    if (ttt2 + a[i] - x < 0) {
      ttt2 += a[i] - x;
      ans2 = min(ans2, ttt2);
    } else
      ttt2 = 0;
  }
  return ans1 + ans2;
}
int main() {
  scanf("%d", &n);
  mi = 9999999;
  mx = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    mi = min(mi, a[i]);
    mx = max(mx, a[i]);
  }
  l = mi;
  r = mx;
  while (r - l > eps) {
    mid = (l + r) / 2;
    if (fff(mid) > 0)
      l = mid;
    else
      r = mid;
  }
  long double x = l;
  long double ttt1 = 0, ttt2 = 0;
  long double ans1 = 0, ans2 = 0;
  int i;
  for (i = 1; i <= n; i++) {
    if (ttt1 + a[i] - x > 0) {
      ttt1 += a[i] - x;
      ans1 = max(ans1, ttt1);
    } else
      ttt1 = 0;
    if (ttt2 + a[i] - x < 0) {
      ttt2 += a[i] - x;
      ans2 = min(ans2, ttt2);
    } else
      ttt2 = 0;
  }
  printf("%.11I64f\n", (double)max(abs(ans1), abs(ans2)));
  return 0;
}
