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;
double a[500008];
long long int n, m, k;
double b[500008];
double f(double mid) {
  double sum = 0.0;
  double arr[n + 7];
  for (int i = 1; i <= n; i++) {
    arr[i] = a[i] - mid;
  }
  double mn = 0;
  double maax = 0;
  for (int i = 1; i <= n; i++) {
    mn += arr[i];
    maax += arr[i];
    mn = min(mn, arr[i]);
    maax = max(maax, arr[i]);
    sum = max(sum, abs(mn));
    sum = max(sum, abs(maax));
  }
  return sum;
}
int main() {
  long long int t = 1;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    double lo = -1e9;
    double hi = 1e9;
    double midl, midr;
    double ans = 1234567891234;
    for (int i = 1; i <= 200; i++) {
      midl = lo + (hi - lo) / 3;
      midr = hi - (hi - lo) / 3;
      if (f(midl) > f(midr)) {
        lo = midl;
      } else
        hi = midr;
      ans = min(ans, f(midl));
      ans = min(ans, f(midr));
    }
    cout << setprecision(15) << fixed;
    cout << ans << endl;
  }
}
