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 = 100 * 1000 * 2 + 10;
int arr[N], n;
double solver(double d, bool reverse) {
  double ret = 0;
  double curr = 0;
  for (int i = 0; i < n; i++) {
    curr += (arr[i] - d) * pow(-1, reverse);
    if (curr < 0) curr = 0;
    ret = max(ret, curr);
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  double ini = -200 * 100 - 2;
  double fim = 200 * 100 + 2;
  int interacoes = 200;
  while (interacoes--) {
    double terco = (fim - ini) / 3.0;
    double ter1 = ini + terco;
    double ter2 = fim - terco;
    double resp1 = max(solver(ter1, false), solver(ter1, true));
    double resp2 = max(solver(ter2, false), solver(ter2, true));
    if (resp1 < resp2) {
      fim = ter2;
    } else {
      ini = ter1;
    }
  }
  printf("%.10f", max(solver((ini + fim) / 2.0, false),
                      solver((ini + fim) / 2.0, true)));
  return 0;
}
