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;
const double eps = 1e-11;
const int maxn = 200000 + 100;
int a[maxn];
double l[maxn];
int n;
double cal(double x) {
  double sum = 0;
  for (int i = 0; i < n; i++) l[i] = a[i] * 1.0 - x;
  double cur = 0;
  for (int i = 0; i < n; i++) {
    cur = cur + l[i];
    if (cur < 0) cur = 0;
    sum = max(sum, cur);
    l[i] = -l[i];
  }
  cur = 0;
  for (int i = 0; i < n; i++) {
    cur = cur + l[i];
    if (cur < 0) cur = 0;
    sum = max(sum, cur);
  }
  return sum;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  double l = -1e4, r = 1e4, m1, m2, v1, v2;
  int t = 100;
  while (t--) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    v1 = cal(m1);
    v2 = cal(m2);
    if (v1 > v2)
      l = m1;
    else
      r = m2;
  }
  printf("%.15f\n", cal(l));
  return 0;
}
