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 maxi, mini, l, r, mid, ma, mi, ta, ti;
long double b[200001];
long double a[200001];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> a[i];
  maxi = a[1], mini = a[1];
  for (int i = 2; i <= n; i++) {
    if (a[i] > maxi) maxi = a[i];
    if (a[i] < mini) mini = a[i];
  }
  l = mini, r = maxi;
  for (int k = 1; k <= 100; k++) {
    mid = (l + r) / 2;
    for (int i = 1; i <= n; i++) b[i] = a[i] - mid;
    ma = 0, ta = 0;
    for (int i = 1; i <= n; i++) {
      ta = ta + b[i];
      if (ta > ma) ma = ta;
      if (ta < 0) ta = 0;
    }
    mi = 0, ti = 0;
    for (int i = 1; i <= n; i++) {
      ti = ti + b[i];
      if (ti < mi) mi = ti;
      if (ti < 0) ti = 0;
    }
    if (ma + mi > 0)
      l = mid;
    else
      r = mid;
  }
  cout << fixed << setprecision(10) << ma << endl;
  return 0;
}
