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.math.*;
public class Main
{
    static class Reader 
    { 
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;} 
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];} 
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;} 
        public String s(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();} 
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;} 
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;} 
        public double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } 
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } 
        public int[] arr(int n){int[] ret = new int[n];for (int i = 0; i < n; i++) {ret[i] = i();}return ret;}
    }
    
    
 
           //       |----|       /\      |    |   -----   |
           //       |   /       /  \     |    |     |     |
           //       |--/       /----\    |----|     |     |
           //       |   \     /      \   |    |     |     |
           //       |    \   /        \  |    |   -----   -------
    static class B implements Comparable<B>
    {
        long x;long y;
        public B(long a,long b)
        {
            x=a;
            y=b;
        }
        public int compareTo(B num) 
        {
            if(y-num.y<0)return -1;
            else if(y==num.y)return 0;
            return 1;
        }
    }

    static int n,t;
    static B arr[];
    static long sum1,sum2;
    public static void main(String[] args)throws IOException
    {
        PrintWriter out= new PrintWriter(System.out);
        Reader sc=new Reader();
        n=sc.i();t=sc.i();
        long arr1[]=new long[n];long arr2[]=new long[n];
        for(int i=0;i<n;i++)arr1[i]=sc.l();for(int i=0;i<n;i++)arr2[i]=sc.l();
        arr=new B[n];
        for(int i=0;i<n;i++)arr[i]=new B(arr1[i],arr2[i]);
        Arrays.sort(arr);
        sum1=0;sum2=0;
        for(int i=0;i<n;i++)
        {
            sum1+=arr[i].x*arr[i].y;
            sum2+=arr[i].x;
        }
        if(t>arr[n-1].y||t<arr[0].y)
        {
            System.out.println(0);
            System.exit(0);
        }
        double ans=sum1*1.0/sum2;
        if(ans==t)
        out.println(sum2);
        else if(ans>t)
        {
            for(int i=n-1;i>=0;i--)
            {
                if((sum1-arr[i].x*arr[i].y)>t*(sum2-arr[i].x))
                {
                    sum1-=arr[i].x*arr[i].y;
                    sum2-=arr[i].x;
                }
                else if((sum1-arr[i].x*arr[i].y)==t*(sum2-arr[i].x))
                {
                    out.println(sum2-arr[i].x);
                    out.flush();System.exit(0);
                }
                else
                {
                    out.println(sum2-(t*sum2-sum1)*1.0/(t-arr[i].y));
                    out.flush();System.exit(0);
                }
            }
            
        }
        else
        {
            for(int i=0;i<n;i++)
            {
                if((sum1-arr[i].x*arr[i].y)<t*(sum2-arr[i].x))
                {
                    sum1-=arr[i].x*arr[i].y;
                    sum2-=arr[i].x;
                }
                else if((sum1-arr[i].x*arr[i].y)==t*(sum2-arr[i].x))
                {
                    out.println(sum2-arr[i].x);
                    out.flush();System.exit(0);
                }
                else
                {
                    out.println(sum2-(t*sum2-sum1)*1.0/(t-arr[i].y));
                    out.flush();System.exit(0);
                }
            }
        }
        out.flush();
    }
}