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.OutputStream;
import java.io.PrintWriter;
import java.util.List;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

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

    static class _954E {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();

            long tt = in.nextInt();

            long[] a = new long[n];

            long xsum = 0;
            long xtsum = 0;

            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }

            long[] t = new long[n];

            List<tap> taps = new ArrayList<>();

            for (int i = 0; i < n; i++) {
                t[i] = in.nextInt();
            }

            long ex = 0;
            int j = 0;
            for (int i = 0; i < n; i++) {
                if (t[i] == tt) {
                    ex += a[i];
                    continue;
                }
                taps.add(new tap(a[i], t[i]));
                j++;
                xsum += a[i];
                xtsum += t[i] * a[i];
            }

            if (j == 0) {
                out.println(ex);
                return;
            }

            n = j;

            if (((double) xtsum / xsum) < tt) {
                taps.sort((t1, t2) -> (int) Math.signum(t1.t - t2.t));

                long cxtsum = xtsum;
                long cxsum = xsum;

                for (int i = 0; i < n; i++) {
                    long nxtsum = cxtsum - taps.get(i).t * taps.get(i).x;
                    long nxsum = cxsum - taps.get(i).x;

                    if (nxsum != 0 && ((double) nxtsum / nxsum) == tt) {
                        out.println(nxsum + ex);
                        return;
                    }

                    double x = ((double) nxtsum - tt * nxsum) / (tt - taps.get(i).t);

                    if (x >= 0) {
                        out.println(nxsum + x + ex);
                        return;
                    }

                    cxtsum = nxtsum;
                    cxsum = nxsum;
                }
            }

            if (((double) xtsum / xsum) == tt) {
                out.println(xsum + ex);
                return;
            }


            taps.sort((t1, t2) -> (int) Math.signum(t2.t - t1.t));

            long cxtsum = xtsum;
            long cxsum = xsum;

            for (int i = 0; i < n; i++) {
                long nxtsum = cxtsum - taps.get(i).t * taps.get(i).x;
                long nxsum = cxsum - taps.get(i).x;

                if (nxsum != 0 && ((double) nxtsum / nxsum) == tt) {
                    out.println(nxsum + ex);
                    return;
                }

                double x = ((double) nxtsum - tt * nxsum) / (tt - taps.get(i).t);

                if (x >= 0) {
                    out.println(nxsum + x + ex);
                    return;
                }

                cxtsum = nxtsum;
                cxsum = nxsum;
            }

            out.println(ex);

        }

        class tap {
            long x;
            long t;

            public tap(long x, long t) {
                this.x = x;
                this.t = t;
            }

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public int nextInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}