#include <bits/stdc++.h>
using namespace std;
double calc_weakness(const vector<int> nums, double x) {
  double min_sum = 0, max_sum = 0;
  double biggest_abs = 0;
  for (int i = nums.size(); i-- > 0;) {
    min_sum = std::min(nums[i] - x, nums[i] - x + min_sum);
    max_sum = std::max(nums[i] - x, nums[i] - x + max_sum);
    biggest_abs = std::max(biggest_abs, std::max(abs(min_sum), abs(max_sum)));
  }
  return biggest_abs;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int(i) = 0; (i) < (n); (i)++) cin >> a[i];
  double low = -20000;
  double high = 20000;
  while (true) {
    double step = (high - low) / 3;
    double p1 = low + step;
    double p2 = p1 + step;
    double v0 = calc_weakness(a, low);
    double v1 = calc_weakness(a, p1);
    double v2 = calc_weakness(a, p2);
    double v3 = calc_weakness(a, high);
    if (v3 - v2 < 1e-7 || (v3 - v2) / max(abs(v3), abs(v2)) < 1e-7) {
      double ans = (v3 + v2) / 2;
      cout.precision(30);
      cout << fixed << ans << endl;
      return;
    }
    if (v1 > v0) {
      high = p1;
      continue;
    }
    if (v2 > v1) {
      high = p2;
      continue;
    }
    low = p1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}
