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[200005];
int n, k, x;
struct node {
  double l, r;
};
inline node check(double v) {
  double a = 0, b = 0;
  double mx_a = 0, mx_b = 0;
  for (int i = 1; i <= n; i++) {
    if (A[i] > v)
      a += 1.0 * (A[i] - v), b = 0;
    else
      a = 0, b += 1.0 * (v - A[i]);
    mx_a = max(mx_a, a);
    mx_b = max(mx_b, b);
  }
  return (node){mx_a, mx_b};
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  double l = -10000, r = 10000;
  double ans = 0;
  while (r - l >= 1e-9) {
    double mid = 1.0 * (l + r) / 2;
    node res = check(mid);
    if (res.r >= res.l) {
      ans = res.r;
      r = mid;
    } else
      l = mid;
  }
  printf("%lf\n", ans);
  return 0;
}
