#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 2;
const long long inf = 1e18 + 43;
const int mod = 1e9 + 7;
const int maxlog = 20;
const long double pi = 3.1415926535897932384626433832795028841971693993751;
long double a[maxn];
int n;
long double get(long double x) {
  long double mini = 0, maxi = 0;
  long double sum = 0;
  for (int i = 0; i < n; i++) {
    long double b = a[i] - x;
    sum += b;
    mini = min(mini, sum);
    maxi = max(maxi, sum);
  }
  return maxi - mini;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  long double l = -1e9, r = 1e9;
  int t = 300;
  while (t--) {
    long double mid1 = l + (r - l) / 3;
    long double mid2 = l + 2 * (r - l) / 3;
    if (get(mid1) >= get(mid2))
      l = mid1;
    else
      r = mid2;
  }
  cout << get(l);
  return 0;
}
