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 long n;
long long a[200005];
double calc(double x) {
  double cur1 = 0;
  double max1 = 0;
  for (long long i = 0; i < n; i++) {
    cur1 += (a[i] - x);
    max1 = max(max1, cur1);
    if (cur1 < 0) cur1 = 0;
  }
  double cur2 = 0;
  double max2 = 0;
  for (long long i = 0; i < n; i++) {
    cur2 += (a[i] - x);
    max2 = min(max2, cur2);
    if (cur2 > 0) cur2 = 0;
  }
  return max(abs(max1), abs(max2));
}
double search() {
  double low = -1 * 10005, high = 10005;
  double EPS = 1e-12;
  long long it = 0;
  while (low < high && it < 300) {
    double mid = (low + high) / 2;
    double lowRes = calc(mid - EPS);
    double midRes = calc(mid);
    double highRes = calc(mid + EPS);
    if (lowRes < midRes && midRes < highRes)
      high = mid;
    else if (lowRes > midRes && midRes > highRes)
      low = mid;
    else
      low = high = mid;
    it++;
  }
  return low;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  double ans = search();
  cout << calc(ans) << endl;
}
