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;
long long A[200050];
double L = -1e6, R = 1e6;
double ans = (1e9);
int N;
double f(double x) {
  double maxm = 0;
  double minm = 0;
  double pre = 0;
  double ans = -1000000009;
  for (int i = 1; i <= N; i++) {
    pre += A[i] - x;
    ans = max(ans, abs(pre - maxm));
    ans = max(ans, abs(pre - minm));
    maxm = max(maxm, pre);
    minm = min(minm, pre);
  }
  return ans;
}
int main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> A[i];
  for (int i = 1; i <= 100; i++) {
    double mid1 = L + (R - L) / (3.0);
    double mid2 = R - (R - L) / (3.0);
    double x = f(mid1), y = f(mid2);
    ans = min(ans, min(x, y));
    if (x < y)
      R = mid2;
    else
      L = mid1;
  }
  cout << fixed << setprecision(15) << ans << endl;
}
