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[200010];
double dp[200010];
int N;
double calc(double x) {
  dp[0] = 0;
  double ret = arr[1] - x;
  for (int i = 1; i <= N; i++) {
    dp[i] = max(dp[i - 1] + arr[i] - x, arr[i] - x);
    ret = max(ret, dp[i]);
  }
  double ret2 = 0;
  for (int i = 1; i <= N; i++) {
    dp[i] = min(dp[i - 1] + arr[i] - x, -x + arr[i]);
    ret2 = min(dp[i], ret2);
  }
  ret = max(0 - ret2, ret);
  return ret;
}
double search(double low, double high) {
  if (high - low < 0.000000000005) return min(calc(low), calc(high));
  double range = (high - low) / 3.0;
  double val1 = calc(low + range);
  double val2 = calc(high - range);
  if (val1 < val2)
    return search(low, high - range);
  else
    return search(low + range, high);
}
void solve() {
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> arr[i];
  double left = -30000, right = 3000;
  printf("%.9lf\n", search(left, right));
  return;
}
int main() {
  solve();
  return 0;
}
