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.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.InputMismatchException;

public class Main {
	public static void main(String[] args) {
		FasterScanner sc = new FasterScanner();

		int N = sc.nextInt();
		int Q = sc.nextInt();
		int[] A = sc.nextIntArray(N);
		int[] T = sc.nextIntArray(N);
		
		long match = 0;
		ArrayList<Tap> below = new ArrayList<>();
		ArrayList<Tap> above = new ArrayList<>();
		long belowA = 0;
		long belowAT = 0;
		long aboveA = 0;
		long aboveAT = 0;
		for (int i = 0; i < N; ++i) {
		  if (T[i] < Q) {
		    below.add(new Tap(A[i], Q - T[i]));
		    belowA += A[i];
		    belowAT += (long)A[i] * (Q - T[i]);
		  } else if (T[i] > Q) {
		    // System.out.printf("above here: %d - %d = %d\n", T[i], Q, T[i] - Q);
		    above.add(new Tap(A[i], T[i] - Q));
		    aboveA += A[i];
		    aboveAT += (long)A[i] * (T[i] - Q);
		  } else {
		    match += A[i];
		  }
		}
		
		if (below.size() == 0 && above.size() == 0) {
		  System.out.println(match);
		  return;
		}
		
		ArrayList<Tap> iter;
		long wantA, wantAT;
		if (belowAT < aboveAT) {
		  iter = above;
		  wantA = belowA;
		  wantAT = belowAT;
		} else {
		  iter = below;
		  wantA = aboveA;
		  wantAT = aboveAT;
		}
		
		long iterA = 0;
		long iterAT = 0;
		double extraA = 0;
		
		Collections.sort(iter, Tap.BY_TDIFF);
		for (int i = 0; i < iter.size(); ++i) {
		  Tap t = iter.get(i);
		  long nextA = iterA + t.amt;
		  long nextAT = iterAT + t.amt * t.tdiff;
		  if (wantAT < nextAT) {
		    extraA = (double)(wantAT - iterAT) / t.tdiff;
		    break;
		  }
		  iterA = nextA;
		  iterAT = nextAT;
		}
		System.out.printf("%.16f\n", match + wantA + iterA + extraA);
	}
	
	public static class Tap {
	  public long amt, tdiff;
	  
	  public Tap(long a, long t) {
	    this.amt = a;
	    this.tdiff = t;
	  }
	  
	  public static final Comparator<Tap> BY_TDIFF = new Comparator<Tap>() {
	    @Override
	    public int compare(Tap lhs, Tap rhs) {
	      return Long.compare(lhs.tdiff, rhs.tdiff);
	    }
	  };
	}

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.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 nextString() {
			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 nextLong() {
			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 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 int[] nextIntArray(int n) {
			return nextIntArray(n, 0);
		}

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

		public long[] nextLongArray(int n) {
			return nextLongArray(n, 0);
		}

		public long[] nextLongArray(int n, int off) {
			long[] arr = new long[n + off];
			for (int i = 0; i < n; i++) {
				arr[i + off] = nextLong();
			}
			return arr;
		}

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

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