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 MAXN = 201010;
int N;
double arr[MAXN];
double brr[MAXN];
double calc() {
  double sum = 0;
  double ans = 0;
  double curmin = 0;
  for (int i = 0; i < N; i++) {
    sum += brr[i];
    ans = max(ans, sum - curmin);
    curmin = min(curmin, sum);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 0; i < N; i++) cin >> arr[i];
  double lb = -22222, rb = 22222;
  while (rb - lb > 1E-11) {
    double mb = (lb + rb) / 2;
    for (int i = 0; i < N; i++) brr[i] = arr[i] + mb;
    double maxsum = calc();
    for (int i = 0; i < N; i++) brr[i] = -arr[i] - mb;
    double minsum = calc();
    if (maxsum > minsum)
      rb = mb;
    else
      lb = mb;
  }
  double ans = (lb + rb) / 2;
  for (int i = 0; i < N; i++) brr[i] = arr[i] + ans;
  double out = calc();
  cout << fixed << setprecision(12) << out << endl;
  return 0;
}
