Problem: We have an old building with n + 2 columns in a row. These columns support the ceiling. These columns are located in points with coordinates 0 = x0 < x1 < ... < xn < xn + 1. The leftmost and the rightmost columns are special, we will call them bearing, the other columns are ordinary. 

For each column we know its durability di. Let's consider an ordinary column with coordinate x. Let's assume that the coordinate of the closest to it column to the left (bearing or ordinary) is a and the coordinate of the closest to it column to the right (also, bearing or ordinary) is b. In this task let's assume that this column supports the segment of the ceiling from point <image> to point <image> (here both fractions are considered as real division). If the length of the segment of the ceiling supported by the column exceeds di, then the column cannot support it and it crashes after a while, and after that the load is being redistributeed between the neighbouring columns according to the same principle.

<image>

Thus, ordinary columns will be crashing for some time until the process stops at some state. One can prove that the set of the remaining columns doesn't depend on the order in which columns crash. If there are only two bearing columns left in the end, then we assume that the whole construction crashes under the weight of the roof. But if at least one ordinary column stays in addition to the bearing ones, then the building doesn't crash.

To make the building stronger, we can add one extra ordinary column of arbitrary durability d' at any (not necessarily integer) point 0 < x' < xn + 1. If point x' is already occupied by an ordinary column, it is replaced by a new one.

Your task is to find out: what minimal durability can the added column have so that the building doesn't crash?

Input

The first line contains integer n (1 ≤ n ≤ 105) — the number of ordinary columns.

The second line contains n + 2 integers x0, x1, ..., xn, xn + 1 (x0 = 0, xi < xi + 1 for 0 ≤ i ≤ n, xn + 1 ≤ 109) — the coordinates of the columns.

The third line contains n integers d1, d2, ..., dn (1 ≤ di ≤ 109).

Output

Print a single number — the minimum possible durability of the column that you need to add in order to make the building stay. If you do not have to add the column, please print 0. Your answer will be checked with the relative or absolute error 10 - 4.

Examples

Input

2
0 20 40 100
15 40


Output

10


Input

3
0 4 10 28 30
9 13 5


Output

0

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long INF = 2000000000005LL;
long long n, m;
long long a[100005], d[100005];
set<long long> s1;
multiset<pair<long long, long long> > s2;
long long now[100005];
long long node[2][2000505];
vector<pair<long long, long long> > to_update[2];
long long c[400505], of[400505];
map<long long, long long> sign;
pair<long long, long long> pillar[400505];
double res = (double)INF;
bool check() {
  for (long long i = 0; i <= n + 1; i++) s1.insert(i);
  for (long long i = 1; i <= n; i++) {
    s2.insert(pair<long long, long long>(d[i] - (a[i + 1] - a[i - 1]) / 2, i));
    now[i] = d[i] - (a[i + 1] - a[i - 1]) / 2;
  }
  while (!s2.empty()) {
    multiset<pair<long long, long long> >::iterator it = s2.begin();
    long long first = (*it).first, i = (*it).second;
    if (first >= 0) break;
    set<long long>::iterator it1 = s1.find(i), it2 = s1.upper_bound(i);
    --it1;
    long long second = (*it1), z = (*it2);
    s1.erase(i);
    s2.erase(it);
    if (second != 0) {
      it = s2.find(pair<long long, long long>(now[second], second));
      s2.erase(it);
      now[second] -= (a[z] - a[i]) / 2;
      s2.insert(pair<long long, long long>(now[second], second));
    }
    if (z != n + 1) {
      it = s2.find(pair<long long, long long>(now[z], z));
      s2.erase(it);
      now[z] -= (a[i] - a[second]) / 2;
      s2.insert(pair<long long, long long>(now[z], z));
    }
  }
  if (s2.empty()) return false;
  return true;
}
long long upper(long long first) {
  long long l = 0, r = n + 2, mid;
  while (l < r) {
    mid = (l + r) / 2;
    if (a[mid] <= first)
      l = mid + 1;
    else
      r = mid;
  }
  return (l - 1);
}
long long lower(long long first) {
  long long l = 0, r = n + 1, mid;
  while (l < r) {
    mid = (l + r + 1) / 2;
    if (a[mid] > first)
      r = mid - 1;
    else
      l = mid;
  }
  if (a[l] == first)
    return l;
  else
    return (l + 1);
}
void update(long long type, long long k, long long p, long long q,
            long long first, long long second, long long z) {
  if (p > q || p > second || first > q) return;
  if (first <= p && q <= second) {
    node[type][k] = z;
    return;
  }
  if (node[type][k] != -1) {
    node[type][2 * k] = node[type][k];
    node[type][2 * k + 1] = node[type][k];
    node[type][k] = -1;
  }
  update(type, 2 * k, p, (p + q) / 2, first, second, z);
  update(type, 2 * k + 1, (p + q) / 2 + 1, q, first, second, z);
}
long long get(long long type, long long k, long long p, long long q,
              long long first) {
  if (p > q || p > first || q < first) return -1;
  if (p == first && first == q) return node[type][k];
  if (node[type][k] != -1) {
    node[type][2 * k] = node[type][k];
    node[type][2 * k + 1] = node[type][k];
    node[type][k] = -1;
  }
  return max(get(type, 2 * k, p, (p + q) / 2, first),
             get(type, 2 * k + 1, (p + q) / 2 + 1, q, first));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (long long i = 0; i <= n + 1; i++) {
    cin >> a[i];
    a[i] *= 2;
  }
  for (long long i = 1; i <= n; i++) {
    cin >> d[i];
    d[i] *= 2;
  }
  if (check()) {
    cout << 0 << endl;
    return 0;
  }
  a[n + 2] = INF;
  c[0] = 2;
  c[1] = a[0];
  c[2] = a[n + 1];
  for (long long i = 1; i <= n + 1; i++) {
    long long first = get(0, 1, 0, n + 1, i);
    if (d[i] * 2 >= a[i] - a[first]) {
      long long second = upper(a[i] + (2 * d[i] - (a[i] - a[first])));
      update(0, 1, 0, n + 1, i, second, i);
      to_update[0].push_back(pair<long long, long long>(
          a[i], min(a[i] + (2 * d[i] - (a[i] - a[first])), a[n + 1])));
      c[0]++;
      c[c[0]] = a[i];
      c[0]++;
      c[c[0]] = min(a[i] + (2 * d[i] - (a[i] - a[first])), a[n + 1]);
    }
  }
  for (long long i = 1; i <= 5 * (n + 2); i++) node[1][i] = n + 1;
  for (long long i = n; i >= 0; i--) {
    long long first = get(1, 1, 0, n + 1, i);
    if (d[i] * 2 >= a[first] - a[i]) {
      long long second =
          lower(max(a[0], a[i] - (2 * d[i] - (a[first] - a[i]))));
      update(1, 1, 0, n + 1, second, i, i);
      to_update[1].push_back(pair<long long, long long>(
          max(a[0], a[i] - (2 * d[i] - (a[first] - a[i]))), a[i]));
      c[0]++;
      c[c[0]] = a[i];
      c[0]++;
      c[c[0]] = max(a[0], a[i] - (2 * d[i] - (a[first] - a[i])));
    }
  }
  sort(c + 1, c + 1 + c[0]);
  m = 1;
  sign[c[1]] = 1;
  of[1] = c[1];
  for (long long i = 2; i <= c[0]; i++) {
    if (c[i] != c[i - 1]) m++;
    sign[c[i]] = m;
    of[m] = c[i];
  }
  for (long long i = 1; i <= 5 * m; i++) {
    node[0][i] = 1;
    node[1][i] = m;
  }
  for (long long i = 2; i < m; i++)
    pillar[i] = pair<long long, long long>(-1, -1);
  for (long long i = 0; i <= 1; i++) {
    for (long long j = 0; j < (long long)to_update[i].size(); j++) {
      long long first = sign[to_update[i][j].first],
                second = sign[to_update[i][j].second],
                z = (i == 0) ? first : second;
      if (i == 0)
        pillar[z].first = get(0, 1, 1, m, z);
      else
        pillar[z].second = get(1, 1, 1, m, z);
      update(i, 1, 1, m, first, second, z);
    }
  }
  for (long long i = 2; i < m; i++) {
    if (pillar[i].first == -1) pillar[i].first = get(0, 1, 1, m, i);
    if (pillar[i].second == -1) pillar[i].second = get(1, 1, 1, m, i);
  }
  for (long long i = 2; i < m; i++) {
    long long first = pillar[i].first, second = pillar[i].second;
    res = min(res, (double)(of[second] - of[first]) / 4.0);
  }
  cout.precision(9);
  cout << fixed << res << endl;
  return 0;
}