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-9;
int arr[MAX_N];
int n;
double decide(double x) {
  double res = 0.0;
  double _max = -20000;
  bool index = 0;
  if (arr[0] - x >= 0) index = 1;
  res = arr[0] - x;
  for (int i = 1; i < n; i++) {
    if (i < n && index && arr[i] - x >= 0)
      res += (arr[i] - x);
    else if (i < n && !index && arr[i] - x <= 0)
      res += (arr[i] - x);
    else {
      _max = max(_max, fabs(res));
      res = arr[i] - x;
      index = !index;
    }
  }
  return max(_max, fabs(res));
}
int main() {
  scanf("%d", &n);
  double l = -20000, r = 20000;
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  double ll, rr;
  while (l + eps < r) {
    ll = (2 * l + r) / 3;
    rr = (2 * r + l) / 3;
    double r1, r2;
    r1 = decide(ll);
    r2 = decide(rr);
    if (r1 <= r2)
      r = rr;
    else
      l = ll;
  }
  printf("%.9lf\n", decide(r));
  return 0;
}
