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 EXP = 1e-11;
const int maxn = 2e5 + 10;
int n;
double a[maxn];
double a2[maxn];
double Judge(double x) {
  double sum1 = 0.0, sum2 = 0.0, sum3 = 0.0;
  for (int i = 1; i <= n; i++) a2[i] = a[i] - x;
  for (int i = 1; i <= n; i++) {
    sum1 = max(sum1 + a2[i], a2[i]);
    sum3 = max(sum3, sum1);
  }
  for (int i = 1; i <= n; i++) a2[i] = a2[i] * (-1.0);
  for (int i = 1; i <= n; i++) {
    sum2 = max(sum2 + a2[i], a2[i]);
    sum3 = max(sum3, sum2);
  }
  return sum3;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  double l = -40000.0, r = 40000.0;
  while (r - l > EXP) {
    double mid = (l + l + r) / 3.0;
    double mmid = (l + r + r) / 3.0;
    if (Judge(mid) >= Judge(mmid))
      l = mid;
    else
      r = mmid;
  }
  printf("%.13lf\n", min(Judge(l), Judge(r)));
  return 0;
}
