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;
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;
}
