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 long long N = 1e6;
const long long INF = 1e18;
int n;
long double a[N];
long double kadane() {
  long double ans = 0;
  long double acum = 0;
  for (long long i = long long(0); i < long long(n); ++i) {
    acum = max(0.0L, acum + a[i]);
    ans = max(ans, acum);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = long long(0); i < long long(n); ++i) cin >> a[i];
  long long may = -INF, men = INF;
  for (long long i = long long(0); i < long long(n); ++i) {
    may = max(may, long long(a[i]));
    men = min(men, long long(a[i]));
  }
  long double x = long double(may + men) / 2.0L;
  for (long long i = long long(0); i < long long(n); ++i) a[i] -= x;
  long double ans = kadane();
  for (long long i = long long(0); i < long long(n); ++i) a[i] *= -1;
  ans = max(ans, kadane());
  cout << setprecision(9) << fixed;
  cout << ans << endl;
  return 0;
}
