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;
int n;
int A[int(2e5)];
long double f(long double x) {
  long double mi = 0, ma = 0, cur = 0, ans = 0;
  for (int i = 0; i < n; ++i) {
    cur += A[i] - x;
    mi = min(mi, cur);
    ma = max(ma, cur);
    ans = max(ans, max(abs(cur - ma), abs(cur - mi)));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> A[i];
  long double l = -20000, r = 20000;
  long double m1, m2;
  while (r - l > 1e-9) {
    m1 = (l + l + r) / 3;
    m2 = (l + r + r) / 3;
    if (f(m1) < f(m2))
      r = m2;
    else
      l = m1;
  }
  cout.precision(12);
  cout.setf(ios::fixed);
  cout << f((l + r) / 2) << endl;
  return 0;
}
