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 getMax(double *arr, double x) {
  for (int i = 0; i < n; i++) arr[i] -= x;
  double cur = arr[0], maxm = arr[0];
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (arr[i] >= 0) {
      flag = true;
    }
    cur = max(arr[i], maxm);
  }
  if (!flag) {
    for (int i = 0; i < n; i++) arr[i] += x;
    return maxm;
  }
  cur = 0, maxm = arr[0];
  for (int i = 0; i < n; i++) {
    cur += arr[i];
    if (cur < 0) cur = 0;
    maxm = max(cur, maxm);
  }
  for (int i = 0; i < n; i++) arr[i] += x;
  return maxm;
}
double getMin(double *arr, double x) {
  for (int i = 0; i < n; i++) arr[i] -= x;
  double cur = arr[0], minm = arr[0];
  bool flag = false;
  for (int i = 0; i < n; i++) {
    if (arr[i] <= 0) {
      flag = true;
    }
    cur = min(cur, minm);
  }
  if (!flag) {
    for (int i = 0; i < n; i++) arr[i] += x;
    return minm;
  }
  cur = 0, minm = arr[0];
  for (int i = 0; i < n; i++) {
    cur += arr[i];
    if (cur > 0) cur = 0;
    minm = min(cur, minm);
  }
  for (int i = 0; i < n; i++) arr[i] += x;
  return minm;
}
double search(double *arr) {
  double lo = *min_element(arr, arr + n);
  double hi = *max_element(arr, arr + n);
  double brr[200200];
  for (int i = 0; i < n; i++) brr[i] = arr[i];
  int t = 200;
  while (t--) {
    double mid = (lo + hi) / 2;
    double maxmp = abs(getMax(brr, mid));
    double maxmn = abs(getMin(brr, mid));
    if (maxmp > maxmn)
      lo = mid;
    else
      hi = mid;
  }
  return (lo + hi) / 2;
}
int main() {
  double arr[200002];
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%lf", &arr[i]);
  }
  double x = search(arr);
  double ans1 = abs(getMax(arr, x));
  double ans2 = abs(getMin(arr, x));
  printf("%.12lf\n", max(ans1, ans2));
  return 0;
}
