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 int N = 2e5 + 77;
const int MOD = 1e9 + 7;
const long long oo = 2e18;
int n, a[N];
long double F(long double x) {
  long double ans = 0;
  long double s1 = 0, s2 = 0;
  for (int i = 1; i <= n; i++) {
    long double elem = a[i] - x;
    s1 += elem;
    s2 += -elem;
    if (s1 < 0) s1 = 0;
    if (s2 < 0) s2 = 0;
    ans = max(ans, max(s1, s2));
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
  }
  long double l = -1e5, r = 1e5;
  for (int i = 0; i < 75; i++) {
    long double m1 = (2 * l + r) / 3, m2 = (2 * r + l) / 3;
    if (F(m1) < F(m2)) {
      r = m2;
    } else {
      l = m1;
    }
  }
  cout << setprecision(10) << F(l);
  return 0;
}
