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;
double arr[200005], temp[200005], dp[200005];
double x;
double minuss, pluss;
void check(double x) {
  minuss = 10000.0, pluss = -10000.0;
  for (int i = 1; i <= n; i++) dp[i] = 0.0;
  for (int i = 1; i <= n; i++) temp[i] = arr[i] - x;
  for (int i = 1; i <= n; i++) dp[i] = max(temp[i], dp[i - 1] + temp[i]);
  for (int i = 1; i <= n; i++) pluss = max(pluss, dp[i]);
  for (int i = 1; i <= n; i++) dp[i] = 0.0;
  for (int i = 1; i <= n; i++) dp[i] = min(temp[i], dp[i - 1] + temp[i]);
  for (int i = 1; i <= n; i++) minuss = min(minuss, dp[i]);
  minuss = abs(minuss);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &arr[i]);
  cout.precision(10);
  double l = -10000.0;
  double r = 10000.0;
  int cnt = 0;
  while (l <= r && cnt < 100) {
    double mid = (l + r) / 2.0;
    check(mid);
    if (pluss > minuss)
      l = mid;
    else if (minuss > pluss)
      r = mid;
    else
      break;
    cnt++;
  }
  cout << max(minuss, pluss) << endl;
  return 0;
}
