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;
int n;
double arr[200005], sorted[200005], pref[200005];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sorted[i] = arr[i];
  }
  sort(sorted, sorted + n);
  pref[0] = arr[0];
  for (int i = 1; i < n; i++) {
    pref[i] = pref[i - 1] + arr[i];
  }
  double lo = -100000;
  double hi = 100000;
  double mid;
  double neg = 0;
  double pos = 10000;
  while (fabs(neg - pos) > 0.00000001 && fabs(lo - hi) > 0.00000001) {
    mid = (lo + hi) / 2;
    int pivot = int(lower_bound(sorted, sorted + n, mid) - sorted);
    if (pivot == 0) {
      neg = 0;
      pos = pref[n - 1] - n * mid;
    } else if (pivot == n) {
      neg = n * mid - pref[n - 1];
      pos = 0;
    } else {
      neg = pivot * mid - pref[pivot - 1];
      pos = pref[n - 1] - pref[pivot - 1] - (n - pivot) * mid;
    }
    if (pos > neg)
      lo = mid;
    else
      hi = mid;
  }
  double max_ending_here = 0, min_ending_here = 0, max_so_far = 0,
         min_so_far = 0;
  for (int i = 0; i < n; i++) {
    arr[i] -= mid;
    max_ending_here = max_ending_here + arr[i];
    if (max_ending_here < 0) max_ending_here = 0;
    if (max_so_far < fabs(max_ending_here)) max_so_far = fabs(max_ending_here);
    min_ending_here = min_ending_here + arr[i];
    if (min_ending_here > 0) min_ending_here = 0;
    if (min_so_far > fabs(min_ending_here)) min_so_far = fabs(min_ending_here);
  }
  printf("%.12lf\n", max(max_so_far, min_so_far));
}
