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 MAXN = 200100;
long long v[MAXN];
long long b[MAXN];
long long n;
long long f(long long x) {
  for (long long i = 1; i <= n; i++) b[i] = v[i] - x;
  long long r = 0;
  long long soma = 0;
  for (long long i = 1; i <= n; i++) {
    soma += b[i];
    if (soma < 0) soma = 0;
    r = max(soma, r);
    b[i] = -b[i];
  }
  soma = 0;
  for (long long i = 1; i <= n; i++) {
    soma += b[i];
    if (soma < 0) soma = 0;
    r = max(soma, r);
  }
  return r;
}
long long bb(long long x, long long y) {
  long long meio = (x + y) / 2;
  cout << "|| " << meio << endl;
  if (x == y) return x;
  if (f(meio + 1) < f(meio))
    return bb(meio + 1, y);
  else
    return bb(x, meio);
}
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> v[i], v[i] *= 1000000000;
  long long h = bb(-10000000000000000, 10000000000000000);
  long double r = ((long double)f(h)) / 1000000000;
  cout << setprecision(13) << fixed << r << endl;
}
