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;
void FastIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int n;
vector<int> a;
double foo(double val) {
  double ret1 = -INT_MAX, ret2 = -INT_MAX, temp1 = 0, temp2 = 0;
  for (int i = 0; i < (int)n; i++) {
    temp1 += a[i] - val;
    temp1 *= (temp1 >= 0);
    ret1 = max(ret1, temp1);
    temp2 += a[i] - val;
    temp2 *= (temp2 <= 0);
    ret2 = max(ret2, fabs(temp2));
  }
  return max(ret1, ret2);
}
int main() {
  FastIO();
  cin >> n;
  a.assign(n, 0);
  for (int i = 0; i < (int)n; i++) {
    cin >> a[i];
  }
  double l = -20000, r = 20000, mid1, mid2, cnt = 400, ans = 0;
  while (cnt--) {
    mid1 = l + (r - l) / 3;
    mid2 = r - ((r - l) / 3);
    double val1 = foo(mid1);
    double val2 = foo(mid2);
    if (mid1 == mid2) {
      ans = val1;
      break;
    } else if (val1 < val2) {
      r = mid2;
    } else {
      l = mid1;
    }
  }
  cout << setprecision(10) << fixed << ans << '\n';
  return 0;
}
