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 oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
const int MX = 200009;
int n;
double a[MX];
int comp(const double &a, const double &b) {
  if (fabs(a - b) < eps) return 0;
  return a > b ? 1 : -1;
}
double calc(double d) {
  double ret = 0;
  for (int i = 0; i < (int)(n); i++) {
    a[i] -= d;
    ret = max(ret, fabs(a[i]));
  }
  double sum = 0;
  for (int i = 0; i < (int)(n); i++) {
    sum += a[i];
    if (sum < 0) sum = 0;
    ret = max(ret, fabs(sum));
  }
  sum = 0;
  for (int i = 0; i < (int)(n); i++) {
    sum += a[i];
    if (sum > 0) sum = 0;
    ret = max(ret, fabs(sum));
  }
  return ret;
}
double calc2(double d) {
  for (int i = 0; i < (int)(n); i++) a[i] -= d;
  double ret = 0;
  for (int i = 0; i < (int)(n); i++)
    for (int j = i; j < (int)(n); j++) {
      double sum = 0;
      for (int k = i; k < (int)(j + 1); k++) sum += a[k];
      ret = max(ret, fabs(sum));
    }
  for (int i = 0; i < (int)(n); i++) a[i] += d;
  return ret;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    int x;
    double sum = 0;
    for (int i = 0; i < (int)(n); i++) {
      scanf("%d", &x);
      a[i] = x;
      sum += x;
    }
    sum /= n;
    printf("%.9lf\n", calc(sum));
    continue;
    cout << calc(2.33333333) << endl;
    cout << calc2(2.33333333) << endl;
    continue;
    double A = -100000, B = 100000;
    while (fabs(A - B) > 1e-9) {
      double p1 = A + ((B - A) / 3);
      double p2 = A + ((2 * (B - A)) / 3);
      double v1 = calc(p1);
      double v2 = calc(p2);
      if (v1 > v2)
        A = p1;
      else
        B = p2;
    }
    double ret = calc(A);
    cout << sum << " " << A << " " << B << endl;
    printf("%.9lf\n", ret);
  }
  return 0;
}
