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 arr[200000];
long double sum(long double x) {
  long double maxF = 0, maxE = 0;
  long double minF = 0, minE = 0;
  for (int i = int(0); i < int(n); i++) {
    maxE = max(arr[i] - x, maxE + arr[i] - x);
    maxF = max(maxF, maxE);
    minE = min(arr[i] - x, minE + arr[i] - x);
    minF = min(minF, minE);
  }
  return max(abs(maxF), abs(minF));
}
long double binSearch() {
  long double lo = -10000, hi = 10000;
  long double x1, x2, s1, s2;
  while (abs(hi - lo) > 1e-12) {
    x1 = (lo + lo + hi) / 3;
    x2 = (lo + hi + hi) / 3;
    s1 = sum(x1);
    s2 = sum(x2);
    if (s1 < s2)
      hi = x2;
    else
      lo = x1;
  }
  return s1;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cin.tie(0), cout.tie(0),
      cout.precision(7);
  while (cin >> n) {
    for (int i = int(0); i < int(n); i++) cin >> arr[i];
    cout << binSearch() << endl;
  }
  return 0;
}
