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;
int n;
int a[200005];
const long long inf = 1LL << 61;
const double err = 1e-11;
inline void compute(double x, double &poormax, double &poormin) {
  poormax = 0, poormin = 0;
  double smax = 0, smin = 0;
  for (int i = 1; i <= n; ++i) {
    double v = a[i] - x;
    if (smax >= 0) {
      smax += v;
    } else {
      smax = v;
    }
    if (smin <= 0) {
      smin += v;
    } else {
      smin = v;
    }
    if (smax >= 0 && smax >= poormax) {
      poormax = smax;
    }
    if (smin <= 0 && smin <= poormin) {
      poormin = smin;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  double init_max, init_min;
  compute(0, init_max, init_min);
  double x;
  if (abs(init_max) >= abs(init_min)) {
    double left = 0, middle, right = init_max;
    while (right - left > err) {
      middle = (left + right) / 2;
      double now_max, now_min;
      compute(middle, now_max, now_min);
      if (abs(now_max) >= abs(now_min)) {
        left = middle + err;
      } else {
        right = middle - err;
      }
    }
    double aux;
    compute(right, x, aux);
  } else {
    double left = init_min, middle, right = 0;
    while (right - left > err) {
      middle = (left + right) / 2;
      double now_max, now_min;
      compute(middle, now_max, now_min);
      if (abs(now_max) >= abs(now_min)) {
        left = middle + err;
      } else {
        right = middle - err;
      }
    }
    double aux;
    compute(left, aux, x);
  }
  printf("%.10lf\n", abs(x));
  return 0;
}
