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;
const long long N = 2e5 + 10, inf = 1e3 + 5, mod = 1e9 + 7, NN = 1e5 + 10;
int n;
long double a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  long double low = *min_element(a, a + n), high = *max_element(a, a + n), mid,
              pos = 0, neg = 0;
  for (int temp = 0; temp < 200; temp++) {
    mid = (high + low) / 2;
    long double c = 0;
    pos = neg = 0;
    for (int i = 0; i < n; i++) {
      c += a[i] - mid;
      if (c < 0.0) c = 0;
      pos = max(c, pos);
    }
    c = 0;
    for (int i = 0; i < n; i++) {
      c += mid - a[i];
      if (c < 0.0) c = 0;
      neg = max(neg, c);
    }
    if (pos > neg)
      low = mid;
    else
      high = mid;
  }
  cout << fixed << setprecision(8) << max(pos, neg);
}
