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 = 200000, MAX = 10000;
double A[N];
int n;
double calc() {
  double ret = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    cur = max(cur + A[i], 0.0);
    ret = max(ret, cur);
  }
  return ret;
}
double f(double delta) {
  for (int i = 0; i < n; i++) A[i] += delta;
  double ret = calc();
  for (int i = 0; i < n; i++) A[i] *= -1;
  ret = max(ret, calc());
  for (int i = 0; i < n; i++) A[i] *= -1;
  for (int i = 0; i < n; i++) A[i] -= delta;
  return ret;
}
double search(double from, double to) {
  for (int i = 0; i < 100; i++) {
    double m1 = (2 * from + to) / 3, m2 = (from + 2 * to) / 3;
    if (f(m1) < f(m2))
      to = m2;
    else
      from = m1;
  }
  return from;
}
bool solve(int testNumber) {
  if (scanf("%d", &n) == EOF) return false;
  for (int i = 0; i < n; i++) scanf("%lf", &A[i]);
  printf("%.12f\n", f(search(-MAX, MAX)));
  return true;
}
int main() {
  for (int i = 1; solve(i); i++)
    ;
  return 0;
}
