#include <bits/stdc++.h>
using namespace std;
const int MX = 2e5 + 5;
int arr[MX], n;
int inc(double mid) {
  double mxP = 0, mxN = 0, cnt = 0;
  vector<double> temp(n);
  for (int i = 0; i < n; i++) temp[i] = arr[i] * 1.0 - mid;
  for (int i = 0; i < n; i++) {
    if (cnt + temp[i] < 0) {
      cnt = 0;
      continue;
    }
    cnt += temp[i];
    mxP = max(mxP, cnt);
  }
  cnt = 0;
  for (int i = 0; i < n; i++) temp[i] *= -1;
  for (int i = 0; i < n; i++) {
    if (cnt + temp[i] < 0) {
      cnt = 0;
      continue;
    }
    cnt += temp[i];
    mxN = max(mxN, cnt);
  }
  return mxP > mxN;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  double l = -10000, h = 10000, ansP = 0, ansN = 0, ans = 0, anss = 0;
  for (int i = 0; i < 200; i++) {
    double mid = (l + h) / 2;
    if (inc(mid))
      l = mid;
    else
      h = mid;
  }
  double mxP = 0, mxN = 0, cnt = 0;
  vector<double> temp(n);
  for (int i = 0; i < n; i++) temp[i] = arr[i] * 1.0 - h;
  for (int i = 0; i < n; i++) {
    if (cnt + temp[i] < 0) {
      cnt = 0;
      continue;
    }
    cnt += temp[i];
    mxP = max(mxP, cnt);
  }
  cnt = 0;
  for (int i = 0; i < n; i++) temp[i] *= -1;
  for (int i = 0; i < n; i++) {
    if (cnt + temp[i] < 0) {
      cnt = 0;
      continue;
    }
    cnt += temp[i];
    mxN = max(mxN, cnt);
  }
  cout << fixed << setprecision(7);
  cout << max(mxP, mxN) << endl;
  return 0;
}
