#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
const double eps = 1e-12;
const double inf = 1e10;
int n, a[maxn];
double dp[2][maxn];
int main() {
  int i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  double t1, t2, mid, lb = -20000, rb = 20000;
  while (rb - lb > eps) {
    mid = (lb + rb) / 2;
    for (i = 0; i < n; i++) dp[0][i] = t1 = -inf, dp[1][i] = t2 = inf;
    for (i = 0; i < n; i++) {
      dp[0][i] = i ? max(a[i] - mid, dp[0][i - 1] + a[i] - mid) : a[i] - mid;
      dp[1][i] = i ? min(a[i] - mid, dp[1][i - 1] + a[i] - mid) : a[i] - mid;
      t1 = max(t1, dp[0][i]);
      t2 = min(t2, dp[1][i]);
    }
    if (t1 + t2 > 0)
      lb = mid;
    else
      rb = mid;
  }
  printf("%.9f\n", t1);
  return 0;
}
