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;
template <class T>
int BIT(int i, T s) {
  return (s >> i) & 1;
}
template <class T>
T ONBIT(int i, T s) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
template <class T>
T gcd(T a, T b) {
  T r;
  int dem = 0;
  while (b != 0) {
    r = a % b;
    dem++;
    a = b;
    b = r;
  }
  cout << dem << endl;
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
const int maxv = 500;
const int maxe = maxv * maxv;
const int inf = (int)1e9 + 5;
const long long linf = (long long)1e16 + 5;
const int dr[] = {-1, 0, +1, 0};
const int dc[] = {0, +1, 0, -1};
const long double eps = 1e-9;
const char IN[] = "_.in";
const char OUT[] = "_.out";
const int maxn = 111111;
const int base = 1e9 + 7;
int test;
long long n;
double l, r, m1, m2;
double a[200111], b[200111];
double nick(double x) {
  for (int i = (1); i <= (n); i++) b[i] = a[i] - x;
  double sum = 0.0;
  double res = 0.0;
  double mi = 0, ma = 0;
  for (int i = (1); i <= (n); i++) {
    sum = sum + b[i];
    res = max(res, abs(sum - mi));
    res = max(res, abs(sum - ma));
    mi = min(mi, sum);
    ma = max(ma, sum);
  }
  return res;
}
int smd(int u) {
  int r = 0;
  while (u > 0) {
    r = r + u % 10;
    u = u / 10;
  }
  return r;
}
int main() {
  cin >> n;
  for (int i = (1); i <= (n); i++) cin >> a[i];
  l = -10005;
  r = 10005;
  for (int i = (1); i <= (200); i++) {
    m1 = (l + l + r) / 3;
    m2 = (l + r + r) / 3;
    if (nick(m1) < nick(m2))
      r = m2;
    else
      l = m1;
  }
  cout << fixed << setprecision(7) << nick(l) << endl;
  return 0;
}
