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 eps = 1e-9;
long long int n;
long double arr[1000000];
long double solve(long double mid) {
  double maxi = 0.0, sum = 0.0;
  for (long long int i = 0; i < n; i++) {
    sum += (arr[i] - mid);
    if (sum < 0) {
      sum = 0;
    }
    maxi = max(abs(sum), maxi);
  }
  sum = 0.0;
  for (long long int i = 0; i < n; i++) {
    sum += (arr[i] - mid);
    if (sum > 0) {
      sum = 0;
    }
    maxi = max(abs(sum), maxi);
  }
  return maxi;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long double lo = -10000.0, hi = 10000.0, mid1, mid2;
  for (long long int i = 1; i <= 100; i++) {
    mid1 = lo + (hi - lo) / 3;
    mid2 = hi - (hi - lo) / 3;
    if (solve(mid1) >= solve(mid2)) {
      lo = mid1;
    } else {
      hi = mid2;
    }
  }
  cout << fixed << setprecision(10) << solve(lo) << endl;
  return 0;
}
