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 MOD = 1000000007;
long double solve(vector<long long>& v, long double x) {
  long double mn = 0;
  long double mx = 0;
  long double ans = 0;
  for (int i = 0; i < (int)v.size(); ++i) {
    long double cur = 1.0 * v[i] - x * (i + 1);
    ans = max(ans, abs(cur - mx));
    ans = max(ans, abs(cur - mn));
    mx = max(mx, cur);
    mn = min(mn, cur);
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < (n); ++i) {
    scanf("%lld", &v[i]);
    if (i) v[i] += v[i - 1];
  }
  long double l = -3e4, r = +3e4, mid1, mid2;
  int iter = 100;
  while (iter--) {
    mid1 = (r - l) / 3.0;
    mid2 = r - mid1;
    mid1 += l;
    long double v1 = solve(v, mid1);
    long double v2 = solve(v, mid2);
    if (v1 < v2) {
      r = mid2;
    } else
      l = mid1;
  }
  mid1 = solve(v, (mid1 + mid2) / 2);
  printf("%.15lf\n", (double)mid1);
  return 0;
}
