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;
int const N = 212212;
int const INF = 1e18 + 7;
long double const EPS = 1e-9;
int a[N], n;
long double pref[N];
long double f(long double x) {
  long double mx = 0.0, mn = 0.0;
  long double ans = 0.0;
  for (int c = 1; c <= n; c++) {
    pref[c] = (long double)a[c] - x;
    pref[c] += pref[c - 1];
  }
  for (int c = 1; c <= n; c++) {
    if (pref[c] >= 0.0) {
      ans = max(ans, abs(pref[c] - mn));
    } else {
      ans = max(ans, abs(pref[c] - mx));
    }
    mx = max(mx, pref[c]);
    mn = min(mn, pref[c]);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int c = 1; c <= n; c++) {
    scanf("%d", &a[c]);
  }
  long double l = -1e10, r = 1e10;
  for (int c = 0; c < 101; c++) {
    long double mid1 = (l + l + r) / 3.0;
    long double f1 = f(mid1);
    long double mid2 = (l + r + r) / 3.0;
    long double f2 = f(mid2);
    if (f1 < f2) {
      r = mid2;
    } else {
      l = mid1;
    }
  }
  cout << fixed << setprecision(20) << f((l + r) / 2) << endl;
  return 0;
}
