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>
void get_min_max(const std::vector<double>& v, double x, double& min,
                 double& max) {
  min = std::numeric_limits<double>::max();
  max = std::numeric_limits<double>::min();
  double s = 0.0;
  double min_bef = 0.0;
  double max_bef = 0.0;
  for (int i = 0; i < v.size(); ++i) {
    s += v[i] - x;
    if (max < s - min_bef) {
      max = s - min_bef;
    }
    if (min > s - max_bef) {
      min = s - max_bef;
    }
    if (s < min_bef) {
      min_bef = s;
    }
    if (s > max_bef) {
      max_bef = s;
    }
  }
}
int main() {
  int N;
  std::cin >> N;
  std::vector<double> v;
  double U = std::numeric_limits<double>::min();
  double L = std::numeric_limits<double>::max();
  for (int i = 0; i < N; ++i) {
    double t;
    std::cin >> t;
    v.push_back(t);
    U = std::max(U, t);
    L = std::min(L, t);
  }
  double sum_min;
  double sum_max;
  for (int I = 0; I < 40; ++I) {
    double M = (U + L) / 2.0;
    get_min_max(v, M, sum_min, sum_max);
    if (std::abs(sum_min) > std::abs(sum_max)) {
      U = M;
    } else {
      L = M;
    }
  }
  std::cout.precision(10);
  std::cout << std::fixed << (std::abs(sum_min) + std::abs(sum_max)) / 2.0
            << "\n";
  return 0;
}
