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 double INF = 1e9;
vector<int> a;
int n;
double Solve(double x) {
  double _max = 0.0;
  double _temp = 0.0;
  double sum = 0.0;
  for (int i = 0; i < n; i++) {
    sum += max(sum + a[i] - x, a[i] - x);
    _max = max(_max, sum);
  }
  sum = 0.0;
  for (int i = 0; i < n; i++) {
    sum += max(sum + x - a[i], x - a[i]);
    _temp = max(_temp, sum);
  }
  return max(_max, _temp);
}
void Process() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.emplace_back(x);
  }
  double left = -1e9;
  double right = 1e9;
  double mid_L, mid_R, ans = 1e9, fx, fy;
  for (int i = 0; i < 300; i++) {
    mid_L = left + (right - left) / 3;
    mid_R = right - (right - left) / 3;
    fx = Solve(mid_L);
    fy = Solve(mid_R);
    if (fx < fy)
      right = mid_R;
    else
      left = mid_L;
  }
  cout << setprecision(14) << fixed << fx << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  Process();
  return 0;
}
