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 a[200005];
double f(double x) {
  int i;
  double sum[200005] = {0}, max = 0, min = 0;
  for (i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[i - 1] - x;
    if (max < sum[i]) max = sum[i];
    if (min > sum[i]) min = sum[i];
  }
  return max - min;
}
int main() {
  scanf("%d", &n);
  int i = 1;
  while (i <= n) {
    scanf("%lf", &a[i]);
    i++;
  }
  double l = -1e9 - 1e7, r = 1e9 + 1e7, m, c;
  for (i = 0; i < 200; i++) {
    m = (l + r) / 2;
    c = (m + r) / 2;
    if (f(m) < f(c))
      r = c;
    else
      l = m;
  }
  printf("%.15lf\n", l);
}
