#include <bits/stdc++.h>
using namespace std;
long double findWeakness(int arr[], int n, long double x) {
  long double minimum = 0, maximum = 0, ans = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    sum += (arr[i] - x);
    long double currBest;
    if (sum < 0)
      currBest = sum - maximum;
    else
      currBest = sum - minimum;
    ans = max(ans, abs(currBest));
    if (sum < minimum) minimum = sum;
    if (sum > maximum) maximum = sum;
  }
  return ans;
}
long double weaknessAndPoorness(int arr[], int n) {
  long double start = INT_MIN, end = INT_MAX, precision = 1e-9, ans = 1e18;
  for (int i = 0; i < 300; i++) {
    long double midLeft = start + (end - start) / 3,
                midRight = end - (end - start) / 3;
    long double costLeft = findWeakness(arr, n, midLeft),
                costRight = findWeakness(arr, n, midRight);
    ans = min(ans, min(costLeft, costRight));
    if (costLeft < costRight)
      end = midRight;
    else
      start = midLeft;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  long double ans = weaknessAndPoorness(arr, n);
  printf("%.12Lf", ans);
  return 0;
}
