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 A[200005];
double T[200005];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  double p = -2e9;
  double q = 2e9;
  double ans1, ans2;
  while (q - p > 1e-9) {
    double m1 = p + (q - p) / 3;
    double m2 = p + 2 * (q - p) / 3;
    for (int j = 0; j < n; j++) T[j] = A[j] - m1;
    double mx = T[0];
    double sum = 0;
    for (int i = 0; i < n; i++) {
      if (sum + T[i] <= 0)
        sum = 0;
      else {
        sum += T[i];
        mx = max(mx, sum);
      }
    }
    sum = 0;
    double mn = T[0];
    for (int i = 0; i < n; i++) {
      if (sum + T[i] >= 0)
        sum = 0;
      else {
        sum += T[i];
        mn = min(mn, sum);
      }
    }
    ans1 = max(abs(mx), abs(mn));
    for (int j = 0; j < n; j++) T[j] = A[j] - m2;
    mx = T[0];
    sum = 0;
    for (int i = 0; i < n; i++) {
      if (sum + T[i] <= 0)
        sum = 0;
      else {
        sum += T[i];
        mx = max(mx, sum);
      }
    }
    sum = 0;
    mn = T[0];
    for (int i = 0; i < n; i++) {
      if (sum + T[i] >= 0)
        sum = 0;
      else {
        sum += T[i];
        mn = min(mn, sum);
      }
    }
    ans2 = max(abs(mx), abs(mn));
    if (ans1 < ans2)
      q = m2;
    else
      p = m1;
  }
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);
  cout << ans1 << "\n";
  return 0;
}
