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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastScanner in = new FastScanner();	
		PrintWriter out = new PrintWriter(System.out);
		int n=in.nextInt();
		int T=in.nextInt();
		P[] pp=new P[200100];
		P[] vec=new P[200100];
		int cnt=0;
		for(int i=1;i<=n;i++) pp[i]=new P();
		for(int i=1;i<=n;i++) {
			pp[i].a=in.nextDouble();
		}
		for(int i=1;i<=n;i++) {
			pp[i].t=in.nextDouble();
			pp[i].t-=1.0*T;
		}
		Arrays.sort(pp,1,n+1);
		double ans=0.0;
		for(int i=1;i<=n;i++) {
			if(pp[i].t==0) ans+=pp[i].a;
			else vec[++cnt]=pp[i];
		}
		n=cnt;
		int pos=0;
		for(pos=1;pos<=n;pos++) {
			if(vec[pos].t>0) break;
		}
		if(pos==1||pos==n+1) out.println(ans);
		else {
			int j=pos-1;
			while(j>=1&&pos<=n) {
				double down=vec[j].a*(-vec[j].t);
				double up=vec[pos].a*vec[pos].t;
				if(down>up) {
					ans+=vec[pos].a;
					ans+=up/(-vec[j].t);
					vec[j].a-=up/(-vec[j].t);
					pos++;
				}
				else if(up==down){
					ans+=vec[pos].a+vec[j].a;
					j--;
					pos++;
				}
				else {
					ans+=vec[j].a;
					ans+=down/(vec[pos].t);
					vec[pos].a-=down/(vec[pos].t);
					j--;
				}
			}
			out.println(ans);
		}
		out.close();
	}
	static class P implements Comparable<P>{
		double a,t;
		P(){
			a=0;
			t=0;
		}
		public P(double aa,double tt) {
			a=aa;
			t=tt;
		}
		public int compareTo(P a) {
			return (int) (t-a.t);
		}
	}
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

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

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

		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a = new long[n];
			for(int i = 0; i < n; i++) a[i] = nextLong();
			return a;
		}

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}
}