#include <bits/stdc++.h>
using namespace std;
double b[300001], sum[300001];
int a[300001];
int n;
double check(double x) {
  for (int i = 1; i <= n; i++) b[i] = a[i] * 1.0 - x;
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
  double Min = 0.0, Max = 0.0;
  double ans = 0.0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, fabs(sum[i] - Min));
    ans = max(ans, fabs(sum[i] - Max));
    Min = min(Min, sum[i]);
    Max = max(Max, sum[i]);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  double l = -999999.0, r = 999999.0;
  double ans = 9999999999999.0;
  bool flag = false;
  for (int i = 1; i <= 200; i++) {
    double mid1 = l + (r - l) / 3.0, mid2 = r - (r - l) / 3.0;
    double tmpx = check(mid1), tmpy = check(mid2);
    if (tmpx > tmpy)
      l = mid1;
    else
      r = mid2;
    if (flag == false) {
      flag = true;
      ans = tmpx;
    } else
      ans = min(ans, tmpx);
    ans = min(ans, tmpy);
  }
  ans = min(ans, check(l));
  printf("%.9f\n", ans);
  return 0;
}
