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.*;
import java.text.*;

public class Main2{
    final long IINF = (long)1e12, mod = (long)1e9+7;
    DecimalFormat df = new DecimalFormat("0.0000000000");
    final double EPS = 1e-8;
    final int MAX = (int)2e5+5;
    FastReader in;
    PrintWriter out;
    boolean multipleTC = false;
    public static void main(String[] args) throws Exception{
        new Thread(null, new Runnable() {
            public void run(){
                try{new Main2().run();}catch(Exception e){e.printStackTrace();}
            }
        }, "1", 1 << 26).start();
    }
    
    void run() throws Exception{
        in = new FastReader();
        out = new PrintWriter(System.out);
        for(int i = 1, t = (multipleTC)?ni():1; i<=t; i++)solve(i);
        out.flush();    
        out.close();
    }
    
    void solve(int tc) throws Exception{
        int n = ni(), t = ni();
        long total = 0, temp = 0;
        Tap[] tap = new Tap[n];
        for(int i = 0; i< n; i++)tap[i] = new Tap(0,0);
        long min = IINF, max = 0;
        for(int i = 0; i< n; i++){
            tap[i].a = nl();
            total+=tap[i].a;
        }
        for(int i = 0; i< n; i++){
            tap[i].temp = nl();
            min = Math.min(min,tap[i].temp);max = Math.max(max,tap[i].temp);
            temp+=tap[i].pro();
        }
        if(temp==t*total)pn(df.format(total));
        else if(min>t || max<t)pn(df.format(0));
        else if(temp<t*total){
            Arrays.sort(tap, new Comparator<Tap>(){
                public int compare(Tap t1, Tap t2){
                    return Long.compare(t1.temp, t2.temp);
                }
            });
            for(int i = 0; i< n; i++){
                if(temp==t*total){
                    pn(df.format(total));break;
                }
                if(temp-tap[i].pro() <= t*(total-tap[i].a)){
                    temp-=tap[i].pro();total-=tap[i].a;
                }else{
                    double x = (temp-t*total)/(1.0*(tap[i].temp-t));
                    pn(df.format(total-x));
                    break;
                }
            }
        }
        else {
            Arrays.sort(tap, new Comparator<Tap>(){
                public int compare(Tap t1, Tap t2){
                    return Long.compare(t2.temp, t1.temp);
                }
            });
            for(int i = 0; i< n; i++){
                if(temp==t*total){
                    pn(df.format(total));break;
                }
                if(temp-tap[i].pro() >= t*(total-tap[i].a)){
                    temp-=tap[i].pro();total-=tap[i].a;
                }else{
                    double x = (temp-t*total)/(1.0*(tap[i].temp-t));
                    pn(df.format(total-x));
                    break;
                }
            }
        }
    }   
    
    class Tap{
        long a,temp;
        public Tap(long A, long T){
            a = A;temp = T;
        }
        long pro(){return a*temp;}
    }
    
    int[] reverse(int[] a){
        int[] o = new int[a.length];
        for(int i = 0; i< a.length; i++)o[i] = a[a.length-i-1];
        return o;   
    }

    int[] sort(int[] a){
        if(a.length==1)return a;
        int mid = a.length/2;
        int[] b = sort(Arrays.copyOfRange(a,0,mid)), c = sort(Arrays.copyOfRange(a,mid,a.length));
        for(int i = 0, j = 0, k = 0; i< a.length; i++){
            if(j<b.length && k<c.length){
                if(b[j]<c[k])a[i] = b[j++];
                else a[i] = c[k++];
            }else if(j<b.length)a[i] = b[j++];
            else a[i] = c[k++];
        }
        return a;
    }

    long[] sort(long[] a){
        if(a.length==1)return a;
        int mid = a.length/2;
        long[] b = sort(Arrays.copyOfRange(a,0,mid)), c = sort(Arrays.copyOfRange(a,mid,a.length));
        for(int i = 0, j = 0, k = 0; i< a.length; i++){
            if(j<b.length && k<c.length){
                if(b[j]<c[k])a[i] = b[j++];
                else a[i] = c[k++];
            }else if(j<b.length)a[i] = b[j++];
            else a[i] = c[k++];
        }
        return a;
    }

    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bitcount(long n){return (n==0)?0:(1+bitcount(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n(){return in.next();}
    int ni() throws Exception{return Integer.parseInt(in.next());}
    long nl() throws Exception{return Long.parseLong(in.next());}
    double nd() throws Exception{return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }
 
        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }
            return str;
        }
    }
}