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;
double a[200010], b[200010];
double bin(double x, int n) {
  double pos, neg, value, mx;
  pos = neg = mx = value = 0.0;
  for (int(i) = (0); (i) < (n); ++(i)) {
    pos += (a[i] - x);
    neg += (a[i] - x);
    if (pos < 0.0) pos = 0.0;
    if (neg > 0.0) neg = 0.0;
    if (value < pos) {
      value = pos;
      mx = pos;
    }
    if (value < abs(neg)) {
      value = abs(neg);
      mx = neg;
    }
  }
  return mx;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int(i) = (0); (i) < (n); ++(i)) {
    cin >> a[i];
  }
  double l = *min_element(a, a + n);
  double r = *max_element(a, a + n);
  double sum, ans, mid;
  ans = (double)INT_MAX;
  double midprev = INT_MIN;
  for (int(t) = (0); (t) < (100); ++(t)) {
    mid = (l + r) / 2.0;
    sum = bin(mid, n);
    ans = min(ans, std::abs(sum));
    if (sum > 0) {
      l = mid;
    } else {
      r = mid;
    }
  }
  cout << ans << "\n";
  return 0;
}
