#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int N = 2e5 + 10;
const double eps = 1e-9;
int n, a[N];
double cal(double x) {
  double ans = 0, cur = 0;
  for (auto i = 1; i <= n; i++) {
    cur = max(.0, cur + a[i] - x);
    ans = max(ans, cur);
  }
  cur = 0;
  for (auto i = 1; i <= n; i++) {
    cur = max(.0, cur + x - a[i]);
    ans = max(ans, cur);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (auto i = 1; i <= n; i++) scanf("%d", a + i);
  double L = -1e4, R = 1e4;
  for (auto phase = 1; phase <= 300; phase++) {
    double L1 = L + (R - L) / 3, R1 = R - (R - L) / 3;
    if (cal(L1) > cal(R1))
      L = L1;
    else
      R = R1;
  }
  printf("%.9f", cal(L));
}
