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 double EPS = 1e-11;
int a[200005];
int n;
double dp[200005];
double calc(double x) {
  double res;
  dp[0] = a[0] - x;
  for (int i = 1; i < n; i++) dp[i] = max(a[i] - x, dp[i - 1] + a[i] - x);
  res = dp[0];
  for (int i = 0; i < n; i++) res = max(res, dp[i]);
  dp[0] = -a[0] + x;
  for (int i = 1; i < n; i++) dp[i] = max(-a[i] + x, dp[i - 1] - a[i] + x);
  for (int i = 0; i < n; i++) res = max(res, dp[i]);
  return res;
}
double solve(double l, double r) {
  double mid, midmid;
  while (l + EPS < r) {
    mid = (l + r) / 2.0;
    midmid = (r + mid) / 2.0;
    if (calc(mid) < calc(midmid))
      r = midmid;
    else
      l = mid;
  }
  return calc(l);
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  cout << setprecision(10) << fixed << solve(0, 10004) << endl;
  return 0;
}
