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[200001];
double cum[200001];
double EPS = 1e-9;
double f(double mid) {
  cum[0] = arr[0] - mid;
  double mini = 0;
  double maxi = 0;
  double ans = 0;
  for (int i = 0; i < n; i++) {
    if (i != 0) cum[i] = (arr[i] - mid) + cum[i - 1];
    ans = max(ans, abs(cum[i] - maxi));
    ans = max(ans, abs(cum[i] - mini));
    maxi = max(maxi, cum[i]);
    mini = min(mini, cum[i]);
  }
  return ans;
}
double ternarySearch(double left, double right) {
  while (right - left > EPS) {
    double g = left + (right - left) / 3, h = left + 2 * (right - left) / 3;
    if (f(g) < f(h))
      right = h;
    else
      left = g;
  }
  return f((left + right) / 2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  cout << fixed << setprecision(10) << ternarySearch(-10000, 10000) << endl;
  return 0;
}
