Problem: You are given a sequence of n integers a1, a2, ..., an. 

Determine a real number x such that the weakness of the sequence a1 - x, a2 - x, ..., an - x is as small as possible.

The weakness of a sequence is defined as the maximum value of the poorness over all segments (contiguous subsequences) of a sequence.

The poorness of a segment is defined as the absolute value of sum of the elements of segment.

Input

The first line contains one integer n (1 ≤ n ≤ 200 000), the length of a sequence.

The second line contains n integers a1, a2, ..., an (|ai| ≤ 10 000).

Output

Output a real number denoting the minimum possible weakness of a1 - x, a2 - x, ..., an - x. Your answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

Examples

Input

3
1 2 3


Output

1.000000000000000


Input

4
1 2 3 4


Output

2.000000000000000


Input

10
1 10 2 9 3 8 4 7 5 6


Output

4.500000000000000

Note

For the first case, the optimal value of x is 2 so the sequence becomes  - 1, 0, 1 and the max poorness occurs at the segment "-1" or segment "1". The poorness value (answer) equals to 1 in this case. 

For the second sample the optimal value of x is 2.5 so the sequence becomes  - 1.5, - 0.5, 0.5, 1.5 and the max poorness occurs on segment "-1.5 -0.5" or "0.5 1.5". The poorness value (answer) equals to 2 in this case.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int IntMaxVal = (int)1e20;
int IntMinVal = (int)-1e20;
long long LongMaxVal = (long long)1e20;
long long LongMinVal = (long long)-1e20;
template <typename T>
inline void minimize(T& a, T b) {
  a = std::min(a, b);
}
template <typename T>
inline void maximize(T& a, T b) {
  a = std::max(a, b);
}
template <typename T>
inline void swap(pair<T, T>& p) {
  swap(p.first, p.second);
}
template <typename T>
struct argument_type;
template <typename T, typename U>
struct argument_type<T(U)> {};
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& s) {
  is >> s.first >> s.second;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < v.size(); i++) {
    if (i) os << ' ';
    os << v[i];
  }
  os << '\n';
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const vector<pair<T1, T2>>& v) {
  for (int i = 0; i < v.size(); i++) {
    os << v[i] << '\n';
  }
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& s, const pair<T1, T2>& t) {
  s << t.first << ' ' << t.second;
  return s;
}
template <typename T>
vector<T> readVector(int n) {
  vector<T> res(n);
  for (int i = 0; i < n; i++) scanf("%d", &res[i]);
  return res;
}
vector<double> vv;
double get_max_sum(int l, int r) {
  if (l == r) return max(0.0, vv[l]);
  double ans = 0;
  int mid = (l + r) / 2;
  maximize(ans, get_max_sum(l, mid));
  maximize(ans, get_max_sum(mid + 1, r));
  double max_prefix = 0;
  double cur_prefix = 0;
  for (int i = mid; i >= l; --i) {
    cur_prefix += vv[i];
    maximize(max_prefix, cur_prefix);
  }
  double max_suffix = 0;
  double cur_suffix = 0;
  for (int i = mid + 1; i < r + 1; ++i) {
    cur_suffix += vv[i];
    maximize(max_suffix, cur_suffix);
  }
  maximize(ans, max_prefix + max_suffix);
  return ans;
}
double check(vector<int>& v2, double x, double& a) {
  int n = v2.size();
  for (int i = 0; i < n; ++i) vv[i] = v2[i] - x;
  double a1 = fabs(get_max_sum(0, n - 1));
  for (int i = 0; i < n; ++i) vv[i] = -vv[i];
  double a2 = fabs(get_max_sum(0, n - 1));
  a = max(a1, a2);
  return a1 > a2;
}
double get_a(vector<int>& v2, double x) {
  int n = v2.size();
  for (int i = 0; i < n; ++i) vv[i] = v2[i] - x;
  double ans = 0;
  maximize(ans, fabs(get_max_sum(0, n - 1)));
  for (int i = 0; i < n; ++i) vv[i] = -vv[i];
  maximize(ans, fabs(get_max_sum(0, n - 1)));
  return ans;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fixed(cout);
  cout << setprecision(10);
  int n;
  scanf("%d", &n);
  auto v = readVector<int>(n);
  vv.resize(n);
  double xl = -1e9;
  double xr = 1e9;
  double al = get_a(v, xl);
  double ar = get_a(v, xr);
  for (int it = 0; it < 100; ++it) {
    double mid = (xr + xl) / 2;
    double a;
    if (check(v, mid, a)) {
      xl = mid;
      al = a;
    } else {
      xr = mid;
      ar = a;
    }
  }
  cout << (al + ar) / 2;
}