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;
using db = long double;
using ll = long long;
using ull = unsigned long long;
using pII = pair<int, int>;
using pLL = pair<ll, ll>;
constexpr int mod = 1e9 + 7;
template <class T1, class T2>
inline void chadd(T1 &x, T2 y, int Mod = mod) {
  x += y;
  while (x >= Mod) x -= Mod;
  while (x < 0) x += Mod;
}
template <class T1, class T2>
inline void chmax(T1 &x, T2 y) {
  if (x < y) x = y;
}
template <class T1, class T2>
inline void chmin(T1 &x, T2 y) {
  if (x > y) x = y;
}
inline int nextInt() {
  int x;
  cin >> x;
  return x;
}
void rd() {}
template <class T, class... Ts>
void rd(T &arg, Ts &...args) {
  cin >> arg;
  rd(args...);
}
void err() {
  cout << "\033[39;0m"
       << "\n";
}
template <class T, class... Ts>
void err(const T &arg, const Ts &...args) {
  cout << arg << ' ';
  err(args...);
}
template <template <typename...> class T, typename t, typename... A>
void err(const T<t> &arg, const A &...args) {
  for (auto &v : arg) cout << v << ' ';
  err(args...);
}
void ptt() { cout << "\n"; }
template <class T, class... Ts>
void ptt(const T &arg, const Ts &...args) {
  cout << ' ' << arg;
  ptt(args...);
}
template <class T, class... Ts>
void pt(const T &arg, const Ts &...args) {
  cout << arg;
  ptt(args...);
}
void pt() {}
template <template <typename...> class T, typename t, typename... A>
void pt(const T<t> &arg, const A &...args) {
  for (int i = 0, sze = arg.size(); i < sze; ++i)
    cout << arg[i] << " \n"[i == sze - 1];
  pt(args...);
}
inline ll qpow(ll base, ll n) {
  assert(n >= 0);
  ll res = 1;
  while (n) {
    if (n & 1) res = res * base % mod;
    base = base * base % mod;
    n >>= 1;
  }
  return res;
}
constexpr int N = 2e5 + 10;
constexpr db eps = 1e-8L;
int n, a[N];
db S[N];
db gao(db x) {
  db res = 0;
  db Min = 0, Max = 0;
  for (int i = 1; i <= n; ++i) {
    S[i] = S[i - 1] + a[i] - x;
    chmax(res, fabs(S[i] - Min));
    chmax(res, fabs(S[i] - Max));
    chmax(Min, S[i]);
    chmin(Max, S[i]);
  }
  return res;
}
void run() {
  int ok = 1;
  for (int i = 1; i <= n; ++i) {
    rd(a[i]);
    if (i > 1 && a[i] != a[i - 1]) ok = 0;
  }
  if (ok) return pt(0.0);
  int cnt = 210;
  db l = -1e4, r = 1e4, res = 2e9;
  while (cnt--) {
    db a = l + (r - l) / 3;
    db b = l + (r - l) / 3 * 2;
    db L = gao(a), R = gao(b);
    if (L <= R) {
      chmin(res, L);
      r = b;
    } else {
      l = a;
    }
  }
  return pt(res);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(20);
  while (cin >> n) run();
  return 0;
}