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 A[233333], n;
double tA[233333], dp[233333], mr[233333];
int dcmp(double x) {
  if (x < -1e-11)
    return -1;
  else if (x > 1e-11)
    return 1;
  else
    return 0;
}
double calc(double x) {
  for (int i = 0; i < n; ++i) {
    tA[i] = A[i] - x;
  }
  dp[0] = mr[0] = max(0.0, tA[0]);
  for (int i = 1; i < n; ++i) {
    mr[i] = max(0.0, tA[i] + mr[i - 1]);
    dp[i] = max(dp[i - 1], mr[i]);
  }
  double y1 = dp[n - 1];
  for (int i = 0; i < n; ++i) {
    tA[i] = x - A[i];
  }
  dp[0] = mr[0] = max(0.0, tA[0]);
  for (int i = 1; i < n; ++i) {
    mr[i] = max(0.0, tA[i] + mr[i - 1]);
    dp[i] = max(dp[i - 1], mr[i]);
  }
  double y2 = dp[n - 1];
  return max(y1, y2);
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; ++i) {
      scanf("%d", &A[i]);
    }
    double L = -2e4, R = 2e4;
    while (dcmp(L - R)) {
      double m1 = L * 2 / 3 + R / 3;
      double m2 = L / 3 + R * 2 / 3;
      if (calc(m1) < calc(m2))
        R = m2;
      else
        L = m1;
    }
    printf("%.9f\n", calc((L + R) / 2.0));
  }
  return 0;
}
