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 int N = 2e5 + 10;
const double eps = 1e-10;
double sa[N];
int n;
double calc(double x) {
  double res = 0.0;
  double sum = 0.0;
  for (int i = 1; i <= n; i++) {
    sum += sa[i] - x;
    if (sum > res) res = sum;
    if (sum < 0.0) sum = 0.0;
  }
  sum = 0.0;
  for (int i = 1; i <= n; i++) {
    sum += x - sa[i];
    if (sum > res) res = sum;
    if (sum < 0.0) sum = 0.0;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &sa[i]);
  double l = -1e8, r = 1e8;
  double m, mm;
  double ans = 1e15;
  while (l + eps < r) {
    m = (l + r) / 2;
    mm = (m + r) / 2;
    double a1 = calc(m);
    double a2 = calc(mm);
    if (a1 <= a2) {
      r = mm;
      ans = min(ans, a1);
    } else {
      l = m;
      ans = min(ans, a2);
    }
  }
  printf("%.10f\n", ans);
  return 0;
}
