Problem: Consider a system of n water taps all pouring water into the same container. The i-th water tap can be set to deliver any amount of water from 0 to ai ml per second (this amount may be a real number). The water delivered by i-th tap has temperature ti.

If for every <image> you set i-th tap to deliver exactly xi ml of water per second, then the resulting temperature of water will be <image> (if <image>, then to avoid division by zero we state that the resulting water temperature is 0).

You have to set all the water taps in such a way that the resulting temperature is exactly T. What is the maximum amount of water you may get per second if its temperature has to be T?

Input

The first line contains two integers n and T (1 ≤ n ≤ 200000, 1 ≤ T ≤ 106) — the number of water taps and the desired temperature of water, respectively.

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 106) where ai is the maximum amount of water i-th tap can deliver per second.

The third line contains n integers t1, t2, ..., tn (1 ≤ ti ≤ 106) — the temperature of water each tap delivers.

Output

Print the maximum possible amount of water with temperature exactly T you can get per second (if it is impossible to obtain water with such temperature, then the answer is considered to be 0).

Your answer is considered correct if its absolute or relative error doesn't exceed 10 - 6.

Examples

Input

2 100
3 10
50 150


Output

6.000000000000000


Input

3 9
5 5 30
6 6 10


Output

40.000000000000000


Input

2 12
1 3
10 15


Output

1.666666666666667

Solution (in JAVA):

Solution:
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		work();
		out.flush();
	}
	long mod=998244353;
	long gcd(long a,long b) {
		return a==0?b:gcd(b%a,a);
	}
	void work() {
		int n=ni();
		long T=nl();
		long[][] A=new long[n][2];
		long e=0,s=0;
		for(int i=0;i<n;i++) {
			A[i][0]=in.nextLong();
			s+=A[i][0];//体积
		}
		for(int i=0;i<n;i++) {
			A[i][1]=in.nextLong();
			e+=A[i][1]*A[i][0];
		}
		Arrays.sort(A,new Comparator<long[]>() {
			public int compare(long[] A1,long[] A2) {
				return A1[1]<A2[1]?-1:A1[1]==A2[1]?0:1;
			}
		});
		if(A[0][1]-T>1e-6||T-A[n-1][1]>1e-6) {
			out.println(0);
			return;
		}
		int p1=0,p2=n-1;
		while(e!=T*s) {
			if(e>T*s) {
				if((e-A[p2][1]*A[p2][0])<=T*(s-A[p2][0])) {//e-x*a1*a2=T*(s-x*a2) ,x=(e-T*s)/(a1*a2-a2*T)
					double x=(e-T*s)/(A[p2][1]*A[p2][0]-A[p2][0]*T);
					x+=((e-T*s)%(A[p2][1]*A[p2][0]-A[p2][0]*T))/(double)(A[p2][1]*A[p2][0]-A[p2][0]*T);
					out.println(s-x*A[p2][0]);
					return;
				}else {
					e-=A[p2][1]*A[p2][0];
					s-=A[p2][0];
					p2--;
				}
			}else {
				if((e-A[p1][1]*A[p1][0])>=T*(s-A[p1][0])) {//e-x*a1=T*(s-x*a2) ,x=(e-T*s)/(a1-a2)
					double x=(e-T*s)/(A[p1][1]*A[p1][0]-A[p1][0]*T);
					x+=((e-T*s)%(A[p1][1]*A[p1][0]-A[p1][0]*T))/(double)(A[p1][1]*A[p1][0]-A[p1][0]*T);
					out.println(s-x*A[p1][0]);
					return;
				}else {
					e-=A[p1][1]*A[p1][0];
					s-=A[p1][0];
					p1++;
				}
			}
		}
		out.println(s);
	}
	
	
	private int search(ArrayList<Integer> list, int v) {
		int l=0,r=list.size();
		while(l<r) {
			int m=(l+r)/2;
			if(list.get(m)<=v) {
				l=m+1;
			}else {
				r=m;
			}
		}
		return list.get(l-1);
	}
	//input
	private ArrayList<Integer>[] ng(int n, int m) {
		ArrayList<Integer>[] graph=(ArrayList<Integer>[])new ArrayList[n];
		for(int i=0;i<n;i++) {
			graph[i]=new ArrayList<>();
		}
		for(int i=1;i<=m;i++) {
			int s=in.nextInt()-1,e=in.nextInt()-1;
			graph[s].add(e);
			graph[e].add(s);
		}
		return graph;
	}
	
	private ArrayList<long[]>[] ngw(int n, int m) {
		ArrayList<long[]>[] graph=(ArrayList<long[]>[])new ArrayList[n];
		for(int i=0;i<n;i++) {
			graph[i]=new ArrayList<>();
		}
		for(int i=1;i<=m;i++) {
			long s=in.nextLong()-1,e=in.nextLong()-1,w=in.nextLong();
			graph[(int)s].add(new long[] {e,w});
			graph[(int)e].add(new long[] {s,w});
		}
		return graph;
	}

	private int ni() {
		return in.nextInt();
	}

	private long nl() {
		return in.nextLong();
	}

	private long[] na(int n) {
		long[] A=new long[n];
		for(int i=0;i<n;i++) {
			A[i]=in.nextLong();
		}
		return A;
	}
	private int[] nia(int n) {
		int[] A=new int[n];
		for(int i=0;i<n;i++) {
			A[i]=in.nextInt();
		}
		return A;
	}
}	

class FastReader
{
	BufferedReader br;
	StringTokenizer st;

	public FastReader()
	{
		br=new BufferedReader(new InputStreamReader(System.in));
	}


	public String next() 
	{
		while(st==null || !st.hasMoreElements())//回车，空行情况
		{
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public int nextInt() 
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}
}