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 JAVA):

Solution:
import java.io.*;
import java.util.*;
public class Main {
	static int n, k;
	static int[] pos, right, left;
	static int[][] spleft;
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		pos = new int[n+2];
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i = 0; i < n+2; i++){
			pos[i] = Integer.parseInt(st.nextToken());
		}
		int[] dur = new int[n+2];
		st = new StringTokenizer(br.readLine());
		for(int i = 1; i < n+1; i++){
			dur[i] = Integer.parseInt(st.nextToken());
		}
		right = new int[n+2]; Arrays.fill(right, 0);
		right[0] = Integer.MAX_VALUE;
		LinkedList<Integer> stack = new LinkedList<>(); stack.addLast(0);
		boolean full = false;
		for(int i = 1; i < n+2; i++){
			while(true){
				int k = stack.getLast();
				if(pos[i] - pos[k] >= 2*dur[i]) break;
				if(right[k] >= pos[i]){
					stack.add(i);
					right[i] = 2*dur[i] + pos[k]; 
					if(right[i] >= pos[n+1]) full = true;
					break;
				} else {
					stack.removeLast();
				}
			}
			if(full) break;
		}
		if(full){
			System.out.println(0); return;
		}
		left = new int[n+2]; Arrays.fill(left, Integer.MAX_VALUE);
		left[n+1] = 0;
		stack = new LinkedList<>(); stack.addLast(n+1);
		for(int i = n+1; i >= 0; i--){
			while(true){
				int k = stack.getLast();
				if(pos[k]-pos[i] >= 2*dur[i]) break;
				if(left[k] <= pos[i]){
					stack.addLast(i);
					left[i] = pos[k] - 2*dur[i]; break;
				} else {
					stack.removeLast();
				}
			}
		} 
		int aux = n+2; k = 0;
		while(aux > 0){ aux >>= 1; k++; }
		spleft = new int[k][n+2];
		for(int i = 0; i < n+2; i++) spleft[0][i] = left[i];
		
		for(int l = 1; l < k; l++){
			int d = 1 << (l-1);
			for(int i = 0; i+d < n+2; i++){
				spleft[l][i] = Integer.min(spleft[l-1][i], spleft[l-1][i+d]);
			}
		}
		
		double a = 0, b = Integer.MAX_VALUE; //tutorial said to use double pointers but i could not figure out how to do that
		while(Math.abs(a-b) > 1e-5){
			double c = (a+b)/2; 					//c = 30;
			if(!check(c)) a = c;
			else b = c;
		}
		System.out.println(a);
	}
	static boolean check(double d){
		for(int i = 0; i < n+1; i++){
			if(right[i] == 0) continue;
			int a = i, b = n+2;
			while(Math.abs(a-b)>1){
				int c = (a+b)/2;
				if(pos[c] <= pos[i] + 2*d) a = c;
				else b = c;
			}
			if(a < i+1) continue;
			if(query(i+1, a) == Integer.MAX_VALUE) continue;
			if(query(i+1, a) <= right[i]) return true;
		}
		return false;
	}
	static int query(int i, int j){
		int r = j-i+1, min = Integer.MAX_VALUE, l = 0, d = 0;
		while(r>0){
			if((r & 1) == 1){
				min = Integer.min(min, spleft[l][i+d]);
				d += 1 << l;
			}
			r >>= 1; l++;
		}
		return min;
	}
}