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 = 3e5 + 5;
double a[N];
int n;
double f(double med) {
  double res = 0;
  double sum = 0;
  for (long long i = 0; i < n; i++)
    if (sum + a[i] - med < 0)
      sum = 0;
    else
      sum += a[i] - med, res = max(res, sum);
  sum = 0;
  for (long long i = 0; i < n; i++)
    if (sum + a[i] - med > 0)
      sum = 0;
    else
      sum += a[i] - med, res = max(res, -sum);
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  double res = 1e9;
  double lo = -1000000, hi = 1000000;
  while (lo + 0.0000001 < hi) {
    double med = (hi + lo) / 2;
    res = min({res, f(med), f(med + 0.0000001)});
    if (f(med) < f(med + 0.0000001))
      hi = med;
    else
      lo = med;
  }
  cout.precision(20);
  cout << res << '\n';
}
