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;
vector<int> adj[1000];
int xMove[] = {1, 0, -1, 0, 1, 1, -1, -1};
int yMove[] = {0, 1, 0, -1, 1, -1, 1, -1};
bool visited[305];
double max_subarray_sum(double arr[], int n) {
  double cur_sum = 0, mx = 0;
  for (int i = 0; i < n; i++) {
    cur_sum += arr[i];
    mx = max(mx, cur_sum);
    if (cur_sum < 0) cur_sum = 0;
  }
  return mx;
}
double weak_ness(double arr[], int n, double x) {
  double new_arr[n];
  for (int i = 0; i < n; i++) new_arr[i] = arr[i] - x;
  double positive_subarray_max_sum = max_subarray_sum(new_arr, n);
  for (int i = 0; i < n; i++) new_arr[i] = new_arr[i] * -1;
  double negative_subarray_max_sum = max_subarray_sum(new_arr, n);
  return max(positive_subarray_max_sum, negative_subarray_max_sum);
}
int main() {
  int TC = 1;
  int n;
  scanf("%d", &n);
  double arr[n];
  for (int i = 0; i < n; i++) scanf("%lf", &arr[i]);
  double lo = *min_element(arr, arr + n), hi = *max_element(arr, arr + n), m1,
         m2;
  while (hi - lo > 1e-10) {
    m1 = lo + (hi - lo) / 3;
    m2 = hi - (hi - lo) / 3;
    double c1 = weak_ness(arr, n, m1), c2 = weak_ness(arr, n, m2);
    if (c1 <= c2)
      hi = m2;
    else
      lo = m1;
  }
  printf("%.9lf\n", weak_ness(arr, n, lo));
  return 0;
}
