10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#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;
}
