#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
double a[maxn], b[maxn];
int n;
double mcs() {
  double ans = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    cur += b[i];
    if (cur > ans) ans = cur;
    if (cur < 0) cur = 0;
  }
  return ans;
}
void calc(double mid, double &a1, double &a2) {
  for (int i = 0; i < n; i++) b[i] = a[i] - mid;
  a1 = mcs();
  for (int i = 0; i < n; i++) b[i] = mid - a[i];
  a2 = mcs();
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  double l = -1e9, r = 1e9, ans = 1e18;
  for (int i = 0; i < 100; i++) {
    double mid = (l + r) / 2, a1, a2;
    calc(mid, a1, a2);
    if (a1 > a2)
      l = mid;
    else
      r = mid;
    ans = min(ans, max(a1, a2));
  }
  printf("%.12f\n", ans);
  return 0;
}
