#include <bits/stdc++.h>
using namespace std;
int a[200000], n;
pair<double, double> go(double x) {
  double sum1 = 0, sum2 = 0, mx1 = 0, mx2 = 0;
  for (int i = 0; i < (int)(n); i++) {
    sum1 += a[i] - x;
    if (sum1 < 0) sum1 = 0;
    mx1 = max(mx1, sum1);
    sum2 += a[i] - x;
    if (sum2 > 0) sum2 = 0;
    mx2 = min(mx2, sum2);
  }
  return make_pair(mx1, mx2);
}
int main() {
  int mx = INT_MIN, mn = INT_MAX;
  cin >> n;
  for (int i = 0; i < (int)(n); i++) {
    scanf("%d", &a[i]);
    a[i] += 10000;
    mx = max(mx, a[i]);
    mn = min(mn, a[i]);
  }
  double l = mn, r = mx, ans = l;
  for (int i = 0; i < (int)(100); i++) {
    double m = (r + l) / 2.0;
    pair<double, double> qq = go(m);
    if (fabs(fabs(qq.first) - fabs(qq.second)) < 1e-9) {
      ans = m;
      break;
    } else if (fabs(qq.first) > fabs(qq.second))
      l = m, ans = m;
    else
      r = m, ans = m;
  }
  printf("%.9lf\n", fabs(go(ans).first));
}
