#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);
}
