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;
const long long N = 1000001, INF = 2000000000000000000;
const long double EPS = 0.000000000001;
int power(int a, int b, int p) {
  if (a == 0) return 0;
  int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % p;
    b >>= 1;
    a = (a * a) % p;
  }
  return res;
}
vector<int> prime;
bool isprime[N];
void pre() {
  for (int i = 2; i < N; i++) {
    if (isprime[i]) {
      for (int j = i * i; j < N; j += i) isprime[j] = false;
      prime.push_back(i);
    }
  }
  return;
}
double fn(int a[], double x, int n) {
  double sum = 0.0;
  double ma = 0.0;
  for (int i = 0; i < n; i++) {
    if (a[i] - x > 0) {
      sum += a[i] - x;
    } else {
      sum = abs(sum);
      ma = max(ma, sum);
      sum = 0;
    }
  }
  sum = abs(sum);
  ma = max(ma, sum);
  sum = 0.0;
  for (int i = 0; i < n; i++) {
    if (a[i] - x < 0) {
      sum += a[i] - x;
    } else {
      sum = abs(sum);
      ma = max(ma, sum);
      sum = 0;
    }
  }
  sum = abs(sum);
  ma = max(ma, sum);
  return ma;
}
double ternary_search(double l, double r, int a[], int n) {
  double eps = 1e-8;
  while (r - l > eps) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    double f1 = fn(a, m1, n);
    double f2 = fn(a, m2, n);
    if (f1 < f2) {
      r = m2;
    } else {
      l = m1;
    }
  }
  return fn(a, l, n);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  int a[n];
  int mi = 1000001, ma = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mi = min(mi, a[i]);
    ma = max(ma, a[i]);
  }
  double ans = ternary_search(mi, ma, a, n);
  cout << fixed << setprecision(6) << ans << "\n";
  return 0;
}
