#include <bits/stdc++.h>
using namespace std;
long long length;
vector<double> nums;
double kadane(double x) {
  double currentMax = nums[0] - x;
  double currentMin = nums[0] - x;
  double globalMax = nums[0] - x;
  double globalMin = nums[0] - x;
  for (unsigned i = 1; i < nums.size(); i++) {
    currentMax = max(nums[i] - x, nums[i] - x + currentMax);
    currentMin = min(nums[i] - x, nums[i] - x + currentMin);
    if (currentMax > globalMax) globalMax = currentMax;
    if (currentMin < globalMin) globalMin = currentMin;
  }
  if (abs(globalMin) < globalMax)
    return globalMax;
  else
    return abs(globalMin);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  double num;
  cin >> length;
  for (int i = 0; i < length; i++) {
    cin >> num;
    nums.push_back(num);
  }
  double l = -10000, r = 10000;
  double m1, m2;
  double resM1, resM2;
  for (int i = 0; i < 200; i++) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    resM1 = kadane(m1);
    resM2 = kadane(m2);
    if (resM1 < resM2)
      r = m2;
    else
      l = m1;
  }
  cout << fixed << setprecision(7) << resM1 << endl;
  return 0;
}
