#include <bits/stdc++.h>
using namespace std;
int t[200005];
int n, k;
double cal(double x) {
  double maxx = 0, minn = 0;
  for (int i = 1; i <= n; i++) {
    double val = -x * i + t[i];
    maxx = max(maxx, val);
    minn = min(minn, val);
  }
  return maxx - minn;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  t[0] = 0;
  for (int i = 1; i <= n; i++) cin >> k, t[i] = t[i - 1] + k;
  double l = -30000, h = 30000;
  int cc = 0;
  for (int i = 1; i <= 100; i++) {
    cc++;
    double r1 = l + (h - l) / 3;
    double r2 = l + (h - l) * 2 / 3;
    double R1 = cal(r1);
    double R2 = cal(r2);
    if (R1 < R2 + 1e-8)
      h = r2;
    else
      l = r1;
  }
  printf("%.9lf", cal((l + h) / 2));
  return 0;
}
