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;
double x, ans, prefix[200005];
int n;
vector<double> a;
priority_queue<double> pq;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int tmp;
    scanf("%d", &tmp);
    a.push_back((double)tmp);
  }
  double l = 0.00, r = 10000.000;
  while (abs(l - r) > 0.000000000000001) {
    double m = (l + r) / 2.00, check = 0.00;
    for (int i = 0; i < n; i++) check += (a[i] - m);
    if (check > 0)
      l = m;
    else
      r = m;
  }
  x = l;
  for (int i = 0; i < (int)a.size(); i++) a[i] -= x;
  prefix[0] = a[0];
  for (int i = 1; i < (int)a.size(); i++) prefix[i] = prefix[i - 1] + a[i];
  ans = -1.00;
  pq.push(0);
  for (int i = 0; i < (int)a.size(); i++) {
    ans = max(abs(prefix[i] - pq.top()), ans);
    pq.push(prefix[i]);
  }
  printf("%.12lf\n", ans);
  return 0;
}
