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 MAX_N = 200000 + 100;
const double eps = 1e-10;
const double INF = 1e10;
double arr[MAX_N];
int n;
double suma[MAX_N], sumb[MAX_N];
double decide(double x) {
  double _max = -INF, _min = INF, sum1 = 0, sum2 = 0;
  for (int i = 0; i < n; i++) {
    if (sum1 >= 0)
      sum1 += (arr[i] - x);
    else
      sum1 = arr[i] - x;
    if (sum2 <= 0)
      sum2 += (arr[i] - x);
    else
      sum2 = arr[i] - x;
    _max = max(_max, sum1);
    _min = min(_min, sum2);
  }
  return max(_max, fabs(_min));
}
double cal(double x) {
  suma[0] = sumb[0] = arr[0] - x;
  for (int i = 1; i < n; i++) {
    suma[i] = max(suma[i - 1] + arr[i] - x, arr[i] - x);
    sumb[i] = min(sumb[i - 1] + arr[i] - x, arr[i] - x);
  }
  double _max = -INF;
  for (int i = 0; i < n; i++) {
    _max = max(_max, suma[i]);
    _max = max(_max, fabs(sumb[i]));
  }
  return _max;
}
int main() {
  scanf("%d", &n);
  double l = -INF, r = INF;
  for (int i = 0; i < n; i++) scanf("%lf", &arr[i]);
  double ll, rr;
  while (l + eps < r) {
    ll = (2 * l + r) / 3;
    rr = (2 * r + l) / 3;
    double r1, r2;
    r1 = cal(ll);
    r2 = cal(rr);
    if (r1 <= r2)
      r = rr;
    else
      l = ll;
  }
  printf("%.9lf\n", cal(r));
  return 0;
}
