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, a[200010];
double getf(long double x) {
  double s = 0, Min = 0, Max = 0;
  for (int i = 1; i <= n; i++) {
    s += (double)a[i] - x;
    Min = min(Min, s);
    Max = max(Max, s);
  }
  return Max - Min;
}
int main() {
  scanf("%d", &n);
  int Min = 1000000, Max = -1000000;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    Min = min(Min, a[i]);
    Max = max(Max, a[i]);
  }
  long double l = Min, r = Max, mid, ma, ml, mr, mb;
  ml = getf(l);
  mr = getf(r);
  while (r - l > 3e-12) {
    mid = (r - l) / 3.0;
    ma = getf(l + mid);
    mb = getf(l + 2 * mid);
    if (ma > mb) {
      ml = ma;
      l = l + mid;
    } else {
      mr = mb;
      r = l + mid + mid;
    }
    if (r - l <= 3e-12) break;
  }
  printf("%.6lf\n", getf(l));
  return 0;
}
