#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<double> A(n), B(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    B[i] = A[i];
  }
  double iter = 0, low1 = -20000, high1 = 20000, mid;
  double ans;
  while (iter <= 400) {
    mid = (low1 + high1) / 2;
    for (int i = 0; i < n; i++) B[i] = A[i] - mid;
    double high = 0, prev = 0;
    for (int i = 0; i < n; i++) {
      prev = prev + B[i];
      high = max(high, prev);
      if (prev < 0) prev = 0;
    }
    double low = 0;
    prev = 0;
    for (int i = 0; i < n; i++) {
      prev = prev + B[i];
      low = min(low, prev);
      if (prev > 0) prev = 0;
    }
    ans = high;
    if (high > -low)
      low1 = mid;
    else if (high < -low)
      high1 = mid;
    iter++;
  }
  printf("%.9f\n", ans);
}
