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 n;
const long double eps = 1e-9;
long double a[200005], l, r, mid1, mid2, b[200005], res = LLONG_MAX;
long double check(long double x) {
  for (int i = 1; i <= n; i++) b[i] = a[i] - x;
  long double sum1 = 0, sum2 = 0, kq = 0;
  for (int i = 1; i <= n; i++) {
    kq = max(kq, abs(b[i]));
    if (b[i] < 0) {
      kq = max(kq, sum2);
      if (sum2 + b[i] < 0)
        sum2 = 0;
      else
        sum2 += b[i];
      sum1 += b[i];
    }
    if (b[i] > 0) {
      kq = max(kq, abs(sum1));
      if (sum1 + b[i] > 0)
        sum1 = 0;
      else
        sum1 += b[i];
      sum2 += b[i];
    }
  }
  kq = max(kq, abs(sum1));
  kq = max(kq, sum2);
  return kq;
}
int main() {
  cin.tie(0), ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  l = -10005, r = 10005;
  while (l + eps < r) {
    mid1 = l + (r - l) / 3;
    mid2 = r - (r - l) / 3;
    long double ans = 0;
    ans = max(ans, check(mid1));
    ans = max(ans, check(mid2));
    if (check(mid1) <= check(mid2)) {
      r = mid2;
      res = min(res, ans);
    } else if (check(mid1) > check(mid2)) {
      l = mid1;
      res = min(res, ans);
    }
  }
  res = min(res, check(a[1]));
  res = min(res, check(-a[1]));
  res = min(res, check(l));
  res = min(res, check(r));
  cout << setprecision(15) << fixed << res << "\n";
}
