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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.SplittableRandom;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            int T = in.nextInt();
            int[] a = in.nextIntArray(n);
            int[] t = in.nextIntArray(n);
            TaskE.Pair[] p = new TaskE.Pair[n];
            for (int i = 0; i < n; ++i) {
                p[i] = new TaskE.Pair(t[i], a[i]);
            }
            ArrayUtils.sort(p);
            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);
                        out.println(x - m);
                        return;
                    }
                    tx -= ctx;
                    x -= cx;
                }
                out.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);
                        out.println(x - m);
                        return;
                    }
                    tx -= ctx;
                    x -= cx;
                }
                out.println(0);
            } else {
                out.println(x);
            }
        }

        static class Pair implements Comparable<TaskE.Pair> {
            int t;
            int a;

            public Pair(int t, int a) {
                this.t = t;
                this.a = a;
            }


            public int compareTo(TaskE.Pair o) {
                return Integer.compare(t, o.t);
            }

        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }

    static class ArrayUtils {
        public static Object[] sort(Object[] a) {
            a = shuffle(a, new SplittableRandom());
            Arrays.sort(a);
            return a;
        }

        public static Object[] shuffle(Object[] a, SplittableRandom gen) {
            for (int i = 0, n = a.length; i < n; i++) {
                int ind = gen.nextInt(n - i) + i;
                Object d = a[i];
                a[i] = a[ind];
                a[ind] = d;
            }
            return a;
        }

    }
}