#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 11;
long long a[N];
int n;
double maxpoor(double x) {
  double min_sum = 0.0;
  double max_sum = 0.0;
  double cur_sum = 0.0;
  double ans = 0.0;
  for (int i = 1; i <= n; i++) {
    cur_sum += a[i] - x;
    ans = max(ans, fabs(cur_sum - min_sum));
    ans = max(ans, fabs(cur_sum - max_sum));
    min_sum = min(min_sum, cur_sum);
    max_sum = max(max_sum, cur_sum);
  }
  return ans;
}
int main() {
  while (1 == scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    double lo = -1e5, hi = 1e5;
    for (int i = 0; i < 200; i++) {
      double left = lo + (hi - lo) / 3.0;
      double right = hi - (hi - lo) / 3.0;
      if (maxpoor(left) < maxpoor(right))
        hi = right;
      else
        lo = left;
    }
    printf("%.8f\n", maxpoor(lo));
  }
  return 0;
}
