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 N = 2e5 + 50;
const double INF = 1e12;
const double EPS = 1e-6;
int n, a[N];
double res = INF;
inline double solve(double x) {
  double prefixSum = 0.0;
  double maxPrefixSum = 0.0;
  double minPrefixSum = 0.0;
  double ans = -INF;
  for (int i = 1; i <= n; i++) {
    prefixSum += ((double)a[i]) - x;
    ans = max(ans, abs(prefixSum - maxPrefixSum));
    ans = max(ans, abs(prefixSum - minPrefixSum));
    maxPrefixSum = max(maxPrefixSum, prefixSum);
    minPrefixSum = min(minPrefixSum, prefixSum);
  }
  res = min(res, ans);
  return ans;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  double l = -1e5, r = 1e5;
  for (int i = 1; i <= 500; i++) {
    double mid = (l + r) / (2.0);
    if ((solve(mid) - solve(mid + 2 * EPS)) < EPS) {
      r = mid - EPS;
    } else {
      l = mid + EPS;
    }
  }
  cout << fixed << setprecision(10) << res << '\n';
}
