#include <bits/stdc++.h>
using namespace std;
int n, a[(int)2e5 + 10];
long double WeekNess, mx = -1e18, mn = 1e18, sum;
long double Answer(long double Check) {
  mx = 0, mn = 0, sum = 0, WeekNess = 0;
  for (int i = 0; i < n; i++) {
    mx = max(mx, sum);
    mn = min(mn, sum);
    sum += a[i] - Check;
    WeekNess = max(WeekNess, fabs(sum - mx));
    WeekNess = max(WeekNess, fabs(sum - mn));
  }
  return WeekNess;
}
long double BinarySol(long double l, long double r) {
  long double mid1 = (2 * l + r) / 3;
  long double mid2 = (2 * r + l) / 3;
  int c = 0;
  while (c++ <= 200) {
    mid1 = (2 * l + r) / 3;
    mid2 = (2 * r + l) / 3;
    if (Answer(mid1) >= Answer(mid2)) {
      l = mid1;
    } else {
      r = mid2;
    }
  }
  return l;
}
int main() {
  cin >> n;
  for (int i = 0; i < n && scanf("%d", a + i); i++)
    ;
  cout << setprecision(6) << fixed << Answer(BinarySol(-1e10, 1e10));
}
