#include <bits/stdc++.h>
using namespace std;
int a[200010], n;
double Get_weekness(double x) {
  double k1 = 0.0, k2 = 0.0, res = 0.0;
  for (int i = 0; i < n; i++) {
    k1 += a[i] - x;
    k2 += a[i] - x;
    if (k1 < 0) k1 = 0.0;
    if (k2 > 0) k2 = 0.0;
    if (k1 > res) res = k1;
    if (-k2 > res) res = -k2;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  double l = -99999.99, r = 99999.99;
  for (int i = 0; i < 100; i++) {
    double k1 = l / 3 * 2 + r / 3;
    double k2 = l / 3 + r / 3 * 2;
    if (Get_weekness(k1) > Get_weekness(k2))
      l = k1;
    else
      r = k2;
  }
  printf("%.12f\n", Get_weekness(l));
  return 0;
}
