#include <bits/stdc++.h>
using namespace std;
int n;
double arr[200005], temp[200005], dp[200005];
double x;
double minuss, pluss;
void check(double x) {
  minuss = 10000.0, pluss = -10000.0;
  for (int i = 1; i <= n; i++) dp[i] = 0.0;
  for (int i = 1; i <= n; i++) temp[i] = arr[i] - x;
  for (int i = 1; i <= n; i++) dp[i] = max(temp[i], dp[i - 1] + temp[i]);
  for (int i = 1; i <= n; i++) pluss = max(pluss, dp[i]);
  for (int i = 1; i <= n; i++) dp[i] = 0.0;
  for (int i = 1; i <= n; i++) dp[i] = min(temp[i], dp[i - 1] + temp[i]);
  for (int i = 1; i <= n; i++) minuss = min(minuss, dp[i]);
  minuss = abs(minuss);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &arr[i]);
  cout.precision(10);
  double l = -10000.0;
  double r = 10000.0;
  int cnt = 0;
  while (l <= r && cnt < 100) {
    double mid = (l + r) / 2.0;
    check(mid);
    if (pluss > minuss)
      l = mid;
    else if (minuss > pluss)
      r = mid;
    else
      break;
    cnt++;
  }
  cout << max(minuss, pluss) << endl;
  return 0;
}
