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 LEN = 200500, INF = 20000;
const long double EPS = 1e-11;
int n;
long double ar[LEN], l, r, m, m1, dp[LEN], dp1[LEN];
long double rec(long double x);
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ar[i];
  l = -INF;
  r = INF;
  cout << setprecision(35) << fixed;
  while (r - l > EPS) {
    m = l + (r - l) / 3.0;
    m1 = r - (r - l) / 3.0;
    if (rec(m) - rec(m1) > EPS)
      l = m;
    else
      r = m1;
  }
  cout << rec(l);
  return 0;
}
long double rec(long double x) {
  long double res = 0, sum;
  dp[0] = ar[0] - x;
  dp1[0] = ar[0] - x;
  res = abs(ar[0] - x);
  for (int i = 1; i < n; i++) {
    dp[i] = max(ar[i] - x, dp[i - 1] + ar[i] - x);
    dp1[i] = min(ar[i] - x, dp1[i - 1] + ar[i] - x);
    res = max(res, max(abs(dp[i]), abs(dp1[i])));
  }
  return res;
}
