#include <bits/stdc++.h>
using namespace std;
double arr[200005];
int n;
double solve(double x) {
  double ans1 = 0, ans2 = 0;
  double val = 0;
  for (int i = 0; i < n; i++) {
    val += (arr[i] - x);
    if (val > ans1) ans1 = val;
    if (val < 0) val = 0;
  }
  val = 0;
  for (int i = 0; i < n; i++) {
    val += (arr[i] - x);
    if (val < ans2) ans2 = val;
    if (val > 0) val = 0;
  }
  return max(ans1, -ans2);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  double l1 = -100000, l2 = 100000;
  double mid1, mid2;
  for (int i = 0; i < 100; i++) {
    mid1 = (l1 + l2) / 2.0;
    mid2 = (mid1 + l2) / 2.0;
    if (solve(mid1) < solve(mid2)) {
      l2 = mid2;
    } else {
      l1 = mid1;
    }
  }
  cout << fixed << setprecision(9) << solve(l2) << endl;
  return 0;
}
