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;
double b[200010], a[200010];
double solve(double x) {
  int i;
  double mn = 1000000000000ll, mx = -1000000000000ll, sum1 = 0, sum2 = 0;
  for (i = 1; i <= n; i++) b[i] = a[i] - x;
  for (i = 1; i <= n; i++) {
    if (b[i] > 0) {
      sum1 += b[i];
      mx = max(mx, sum1);
      sum2 = 0;
    }
    if (b[i] < 0) {
      sum2 += b[i];
      mn = min(mn, sum2);
      sum1 = 0;
    }
  }
  return max(mx, -mn);
}
int main() {
  int i, t = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%lf", &a[i]);
  double l = -10000, r = 10000, mid, midmid;
  for (t = 1; t <= 100; t++) {
    mid = (l + r) / 2;
    midmid = (r + mid) / 2;
    if (solve(mid) <= solve(midmid))
      r = midmid;
    else
      l = mid;
  }
  printf("%.10lf\n", solve(l));
  return 0;
}
