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 = 200010;
int n, v[maxn];
double dp[maxn][2];
double get_poorness(const double w) {
  dp[0][0] = dp[0][1] = 0.0;
  double ans = 0.0;
  for (int k = (1); k <= (n); ++k) {
    double e = v[k] - w;
    if (e < 0) {
      dp[k][0] = max(0.0, dp[k - 1][0] + e);
      dp[k][1] = dp[k - 1][1] - e;
      ans = max(ans, dp[k][1]);
    } else {
      dp[k][0] = dp[k - 1][0] + e;
      dp[k][1] = max(0.0, dp[k - 1][1] - e);
      ans = max(ans, dp[k][0]);
    }
  }
  return ans;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = (1); i <= (n); ++i) scanf("%d", &v[i]);
    double l = -1e4, r = 1e4;
    double p1, p2;
    while (r - l > 1e-10) {
      double m1 = l + (r - l) / 3.0;
      double m2 = l + (r - l) / 3.0 * 2.0;
      p1 = get_poorness(m1);
      p2 = get_poorness(m2);
      if (p1 < p2) {
        r = m2;
      } else {
        l = m1;
      }
    }
    printf("%.10lf\n", p1);
  }
  return 0;
}
