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>
#pragma GCC optimize("O3")
using namespace std;
int n, a[200005];
long double eps = 1e-11, b[200005], s[200005];
long double f(long double first) {
  long double mn = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    b[i] = -first + a[i];
    s[i] = s[i - 1] + b[i];
    ans = max(ans, s[i] - mn);
    mn = min(mn, s[i]);
  }
  mn = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, mn - s[i]);
    mn = max(mn, s[i]);
  }
  return ans;
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long double l = -1e9, r = 1e9;
  for (int i = 1; i <= 200; i++) {
    long double mid1 = (l * 2 + r) / 3, mid2 = (l + r * 2) / 3;
    if (f(mid1) > f(mid2))
      l = mid1;
    else if (f(mid1) < f(mid2))
      r = mid2;
    else
      l = mid1, r = mid2;
  }
  cout << fixed << setprecision(7) << f(l);
}
