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;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    double sum = 0;
    int x;
    for (int i = 0; i < (int)(n); i++) {
      scanf("%d", &x);
      a[i] = x;
      sum += a[i];
    }
    sum /= n;
    for (int i = 0; i < (int)(n); i++) a[i] -= sum;
    sum = a[0];
    double ret = fabs(sum);
    for (int i = 1; i < (int)(n); i++) {
      int x = comp(sum, 0);
      sum += a[i];
      int y = comp(sum, 0);
      if (x != y) sum = a[i];
      ret = max(ret, fabs(sum));
    }
    printf("%.9lf\n", ret);
  }
  return 0;
}
