#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++) {
    a += 1.0 * (A[i] - v);
    if (a < 0) a = 0;
    mx_a = max(mx_a, a);
  }
  for (int i = 1; i <= n; i++) {
    b += 1.0 * (v - A[i]);
    if (b < 0) b = 0;
    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;
  int num = 100;
  while (num--) {
    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;
}
