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>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
const int N = 4 * (100000 + 5);
int n;
long long x[N], d[N];
long long di[N];
vector<int> hanel[N];
bool isadded[N];
vector<int> v;
void solvefor() {
  v.push_back(0);
  di[0] = 2 * d[0];
  for (int i = 1; i <= (int)(n + 1); ++i) {
    while (1) {
      int in = v.back();
      if (x[in] + di[in] < x[i]) {
        hanel[i].push_back(in);
        v.pop_back();
      } else
        break;
    }
    if (i == n + 1) break;
    int in = v.back();
    di[i] = 2 * d[i] - (x[i] - x[in]);
    if (di[i] <= 0) {
      isadded[i] = false;
    } else {
      isadded[i] = true;
      while (((int)((v).size())) >= 2) {
        int in = v.back();
        if (x[in] + di[in] <= x[i] + di[i]) {
          hanel[i].push_back(in);
          v.pop_back();
        } else
          break;
      }
      v.push_back(i);
    }
  }
}
void reversing() {
  for (int i = 0; i < (int)(n + 2); ++i) x[i] = x[n + 1] - x[i];
  reverse(x, x + n + 2);
  reverse(d, d + n + 2);
}
vector<int> t;
vector<int> V;
long long D[N];
long long res;
void F() {
  for (int j = 0; j < (int)(((int)((t).size()))); ++j) {
    int in = t[j];
    int s = 0, f = ((int)((V).size())) - 1, re = 0;
    while (s <= f) {
      int md = (s + f) / 2;
      int in2 = V[md];
      if (x[in2] + di[in2] >= x[in] - D[in]) {
        re = md;
        s = md + 1;
      } else
        f = md - 1;
    }
    res = min(res, x[in] - x[V[re]]);
  }
}
void addV(int i) { V.push_back(i); }
void addT(int i) { t.push_back(i); }
void popV() { V.pop_back(); }
void popT() { t.pop_back(); }
vector<int> adding[N];
vector<int> solving[N];
long long ma[4 * N];
void update(int v, int tl, int tr, int pos, long long val) {
  if (tl == tr) {
    ma[v] = max(ma[v], val);
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos <= tm) {
    update(v + v, tl, tm, pos, val);
  } else
    update(v + v + 1, tm + 1, tr, pos, val);
  ma[v] = max(ma[v + v], ma[v + v + 1]);
}
long long get(int v, int tl, int tr, int l, int r) {
  if (tl >= l && tr <= r) return ma[v];
  int tm = (tl + tr) / 2;
  long long res = 0;
  if (l <= tm) res = max(res, get(v + v, tl, tm, l, r));
  if (r >= tm) res = max(res, get(v + v + 1, tm + 1, tr, l, r));
  return res;
}
void solvegetres() {
  addT(n + 1);
  D[n + 1] = 2 * d[n + 1];
  res = D[n + 1];
  V = v;
  for (int j = (int)(((int)((hanel[n + 1]).size()))) - 1; j >= 0; --j)
    addV(hanel[n + 1][j]);
  for (int i = (int)(n + 1) - 1; i >= 0; --i) {
    while (1) {
      int in = t.back();
      if (x[in] - D[in] > x[i]) {
        popT();
      } else
        break;
    }
    if (i == 0) break;
    if (isadded[i]) popV();
    for (int j = (int)(((int)((hanel[i]).size()))) - 1; j >= 0; --j)
      addV(hanel[i][j]);
    int in = t.back();
    D[i] = 2 * d[i] - (x[in] - x[i]);
    if (D[i] > 0) {
      while (((int)((t).size())) >= 2) {
        int in = t.back();
        if (x[in] - D[in] >= x[i] - D[i]) {
          popT();
        } else
          break;
      }
      addT(i);
    }
  }
  vector<pair<long long, long long> > a;
  map<long long, int> se;
  for (int i = 0; i < (int)(n + 1); ++i)
    if (di[i] > 0) {
      a.push_back(make_pair(x[i], x[i] + di[i]));
      se.insert(make_pair(x[i], 0));
      se.insert(make_pair(x[i] + di[i], 0));
    }
  vector<pair<long long, long long> > b;
  for (int i = (int)(n + 1); i >= 1; --i)
    if (D[i] > 0) {
      b.push_back(make_pair(x[i] - D[i], x[i]));
      se.insert(make_pair(x[i], 0));
      se.insert(make_pair(x[i] - D[i], 0));
    }
  vector<long long> c;
  for (map<long long, int>::iterator it = se.begin(); it != se.end(); ++it) {
    it->second = ((int)((c).size()));
    c.push_back(it->first);
  }
  for (int i = 0; i < (int)(((int)((a).size()))); ++i) {
    int in = se[a[i].first];
    adding[in].push_back(se[a[i].second]);
  }
  for (int i = 0; i < (int)(((int)((b).size()))); ++i) {
    int in = se[b[i].second];
    solving[in].push_back(se[b[i].first]);
  }
  long long res = 2 * x[n + 1];
  for (int i = 0; i < (int)(((int)((c).size()))); ++i) {
    for (int j = 0; j < (int)(((int)((solving[i]).size()))); ++j) {
      long long val = get(1, 0, ((int)((c).size())) - 1, solving[i][j],
                          ((int)((c).size())) - 1);
      res = min(res, c[i] - val);
    }
    for (int j = 0; j < (int)(((int)((adding[i]).size()))); ++j)
      update(1, 0, ((int)((c).size())) - 1, adding[i][j], c[i]);
  }
  cout << (double)res / 2.0 << endl;
}
void solve() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n + 2); ++i) {
    int tmp;
    scanf("%d", &tmp);
    x[i] = tmp;
  }
  for (int i = 1; i <= (int)(n); ++i) {
    int tmp;
    scanf("%d", &tmp);
    d[i] = tmp;
  }
  d[0] = x[n + 1];
  d[n + 1] = x[n + 1];
  solvefor();
  if (v.back() != 0) {
    puts("0");
    return;
  }
  solvegetres();
}
void testgen() {
  FILE* f = fopen("input.txt", "w");
  fclose(f);
}
int main() {
  cout << fixed;
  cout.precision(12);
  cerr << fixed;
  cerr.precision(3);
  solve();
  return 0;
}