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;
long long MulModL(long long B, long long P, long long M) {
  long long R = 0;
  while (P > 0) {
    if ((P & 1ll) == 1) {
      R = (R + B);
      if (R >= M) R -= M;
    }
    P >>= 1ll;
    B = (B + B);
    if (B >= M) B -= M;
  }
  return R;
}
long long MulModD(long long B, long long P, long long M) {
  long long I = ((long double)B * (long double)P / (long double)M);
  long long R = B * P - M * I;
  R = (R % M + M) % M;
  return R;
}
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return R;
}
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
const int MAX = 200009;
double val[MAX];
double csum[MAX];
int main() {
  int n;
  scanf("%d", &n);
  int v;
  double sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &v);
    val[i] = v;
    sum += v;
  }
  sum /= (1.0 * n);
  for (int i = 1; i <= n; i++) {
    val[i] -= sum;
  }
  double res = 0;
  sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += val[i];
    res = max(res, fabs(val[i]));
  }
  res = max(res, fabs(sum));
  sum = 0;
  double s = 1.0;
  for (int i = 1; i <= n; i++) {
    sum += val[i] * s;
    if (!(sum > 0.0)) {
      sum = val[i] * s;
    }
    res = max(res, sum);
  }
  s = -1.0;
  sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += val[i] * s;
    if (!(sum > 0.0)) {
      sum = val[i] * s;
    }
    res = max(res, sum);
  }
  printf("%.12lf", res);
  return 0;
}
