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;
double arr[200005];
int n;
double solve(double x) {
  double ans1 = 0, ans2 = 0;
  double val = 0;
  for (int i = 0; i < n; i++) {
    val += (arr[i] - x);
    if (val > ans1) ans1 = val;
    if (val < 0) val = 0;
  }
  val = 0;
  for (int i = 0; i < n; i++) {
    val += (arr[i] - x);
    if (val < ans2) ans2 = val;
    if (val > 0) val = 0;
  }
  return max(ans1, -ans2);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  double l1 = -100000, l2 = 100000;
  double mid1, mid2;
  for (int i = 0; i < 100; i++) {
    mid1 = (l1 + l2) / 2.0;
    mid2 = (mid1 + l2) / 2.0;
    if (solve(mid1) < solve(mid2)) {
      l2 = mid2;
    } else {
      l1 = mid1;
    }
  }
  cout << fixed << setprecision(9) << solve(l2) << endl;
  return 0;
}
