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 poorness(vector<int> v, double x) {
  double total_max = abs(v[0] - x);
  double max_sum = v[0] - x;
  double min_sum = v[0] - x;
  double sum_total_max = max_sum;
  double sum_total_min = min_sum;
  for (int i = 1; i < v.size(); i++) {
    max_sum = max(v[i] - x, v[i] + max_sum - x);
    min_sum = min(v[i] - x, v[i] + min_sum - x);
    sum_total_max = max(sum_total_max, max_sum);
    sum_total_min = min(sum_total_min, min_sum);
    total_max = max(abs(sum_total_max), abs(sum_total_min));
  }
  return total_max;
}
double ternary_search(vector<int> v, double left, double right, int step) {
  if (step == 100) {
    return poorness(v, (right + left) / 2);
  }
  double new_left = left + (right - left) / 3;
  double new_right = new_left + (right - left) / 3;
  if (poorness(v, new_left) < poorness(v, new_right)) {
    return ternary_search(v, left, new_right, step + 1);
  } else {
    return ternary_search(v, new_left, right, step + 1);
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  cout << ternary_search(v, -10000, 10000, 0) << endl;
  return 0;
}
