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;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MAXV = 1e4;
const int MAXN = 2e5;
int N, a[MAXN + 1];
long double f(long double x) {
  long double ans = 0, sum = 0;
  for (int i = 0; i < N; i++) {
    sum += (long double)a[i] - x;
    if (sum < 0) sum = 0;
    ans = max(ans, sum);
  }
  sum = 0;
  for (int i = 0; i < N; i++) {
    sum += (long double)a[i] - x;
    if (sum > 0) sum = 0;
    ans = max(ans, abs(sum));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  long double l = -MAXV, r = MAXV, eps = (1e-9);
  while (r - l > eps) {
    long double m1 = l + (r - l) / 3;
    long double m2 = r - (r - l) / 3;
    long double r1 = f(m1);
    long double r2 = f(m2);
    if (r1 > r2)
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(9) << f(l);
}
