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 linf = 1000000000000000043;
const int inf = 1000000043;
void pause(bool a = true) {}
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <class T>
const T sqr(const T x) {
  return abs(x * x);
}
unsigned long long powi(unsigned long long a, unsigned long long b,
                        long long mod = linf) {
  if (b == 1) return a;
  return (powi((a * a) % mod, b / 2) * (b % 2 ? a : 1)) % mod;
}
bool isn(char c) { return ('0' <= c && c <= '9'); }
template <class T>
bool read(T &out) {
  int c = getchar(), sign = 1;
  T num = 0;
  for (; !isn(c) && c != '-'; c = getchar())
    if (c == EOF) return false;
  if (c == '-') {
    sign = -1;
    c = getchar();
  }
  if (c == EOF) return false;
  for (; isn(c); c = getchar()) num = num * 10 + c - '0';
  out = sign * num;
  return true;
}
long long time_limit = 1000000;
long long start = clock();
bool time_break() {
  int g = clock();
  return (clock() - start > time_limit * 0.8);
}
long long fact(long long n, long long mod = linf) {
  long long g = 1;
  for (int i = 0; i < (n - 1); i++) g *= (i + 1);
  return g;
}
void init(long long tl = 1000000) {
  ios::sync_with_stdio(false);
  srand(time(0));
  time_limit = tl;
}
int a[200000];
int n;
long double sum(long double x) {
  long double ps = 0, mps = -100000;
  long double ns = 0, mns = 100000;
  for (int i = 0; i < (n); i++) {
    ps += a[i] - x;
    ps = max(long double(0), ps);
    ns += a[i] - x;
    ns = min(long double(0), ns);
    mns = min(mns, ns);
    mps = max(mps, ps);
  }
  return max(mps, -mns);
}
int main() {
  init();
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  long double l = -50000;
  long double r = 50000;
  while (abs(l - r) > 1e-8) {
    long double m1 = (l * 2 + r) / 3;
    long double m2 = (l + r * 2) / 3;
    if (sum(m1) > sum(m2))
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(6) << sum((l + r) / 2) << endl;
  pause();
  return 0;
}
