#include <bits/stdc++.h>
using namespace std;
vector<int> v1;
pair<int, int> p1;
double a[1234567];
string s;
int dp[1001];
double max1 = 0.0000000000, max2 = 0.00000000;
double b[200001];
int n;
double check(double b[]) {
  int i;
  double max_upto = 0.0000, overall = 0.0000;
  for (i = 0; i < n; i++) {
    max_upto += b[i];
    if (max_upto > overall) overall = max_upto;
    if (max_upto < 0) max_upto = 0;
  }
  return overall;
}
int main() {
  int t;
  int i, j, k, m;
  scanf("%d", &n);
  for (i = 0; i < n; i++) cin >> a[i];
  double l = -1000000000.0000;
  double h = 1000000000, mid;
  for (j = 0; j < 100; j++) {
    mid = (l + h) / 2;
    for (i = 0; i < n; i++) b[i] = a[i] - mid;
    max1 = check(b);
    for (i = 0; i < n; i++) b[i] *= (-1);
    max2 = check(b);
    if (max1 > max2)
      l = mid;
    else
      h = mid;
  }
  printf("%.12lf\n", max(max1, max2));
  return 0;
}
