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:
//package com.company;

import java.io.*;
import java.util.*;

public class Main {
    static long TIME_START, TIME_END;
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
//        Scanner sc = new Scanner(new FileInputStream("Test.in"));
        PrintWriter pw = new PrintWriter(System.out);
//        PrintWriter pw = new PrintWriter(new FileOutputStream("Test.in"));
        TIME_START = System.currentTimeMillis();
        Task t = new Task();
        t.solve(sc, pw);
        TIME_END = System.currentTimeMillis();
//        pw.println("Time used: " + (TIME_END - TIME_START) + ".");
        pw.close();
    }

    public static class Task {
        public class Pair{
            int a;
            int t;

            public Pair(int a, int t) {
                this.a = a;
                this.t = t;
            }
        }
        public void solve(Scanner sc, PrintWriter pw) throws IOException {
            int n = sc.nextInt();
            int T = sc.nextInt();
            int[] a = new int[n];
            int[] t = new int[n];
            Pair[] p = new Pair[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            for (int i = 0; i < n; i++) {
                t[i] = sc.nextInt();
            }
            for (int i = 0; i < n; i++) {
                p[i] = new Pair(a[i], t[i]);
            }
            Arrays.sort(p, new Comparator<Pair>() {
                @Override
                public int compare(Pair p1, Pair p2) {
                    return p1.t - p2.t;
                }
            });
            long tx = 0; long x = 0;
            for (int i = 0; i < n; i++) {
                x += p[i].a;
                tx += (long)p[i].a * p[i].t;
            }
            double tt = (tx + 0.0) / x;
            if (tt < T) {
                for (int i = 0; i < n; i++) {
                    long cx = p[i].a;
                    long ctx = (long)p[i].a * p[i].t;
                    if ((tx - ctx + 0.0) >= T * (x - cx)) {
                        double m = (tx - T * x + 0.0) / (p[i].t - T);
                        pw.println(x - m);
                        return;
                    }
                    tx -= ctx;
                    x -= cx;
                }
                pw.println(0);
            } else if (tt > T){
                for (int i = n - 1; i >= 0; i--) {
                    long cx = p[i].a;
                    long ctx = (long)p[i].a * p[i].t;
                    if ((tx - ctx + 0.0) <= T * (x - cx)) {
                        double m = (tx - T * x + 0.0) / (p[i].t - T);
                        pw.println(x - m);
                        return;
                    }
                    tx -= ctx;
                    x -= cx;
                }
                pw.println(0);
            } else {
                pw.println(x);
            }
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}

        public Scanner(FileReader s) throws FileNotFoundException {br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {return br.readLine();}

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

        public boolean ready() throws IOException {return br.ready();}
    }
}