lets-play-game
Source: hackerearth
Difficulty: UNKNOWN_DIFFICULTY

David is playing a game. Currently in the game, he is at a field full of stones. There are total N kinds of
stones. There is unlimited supply of each kind of stone.

David knows that one stone of kind i needs Ai minutes to pick it from the ground and it will give David a profit of
Bi Rs.

David has K minutes of free time. During this free time, David want to pick stones so as to maximize his profit.
But he can not pick stones of different kinds, he has to pick stones of a single kind.

Please help David to find the maximal possible profit. 

INPUT
First line contains single integer T denoting the number of test cases. 
First line of each test case contains two integers N and K. 
Next line contains N integers Ai denoting the time needed to pick one stone of kind i. 
Next line contains N integers Bi denoting the profit due to picking ithth stone. 

OUTPUT

For each test case, print a single line containing maximal possible profit. 

CONSTRAINTS

1 ≤ T ≤ 5

1 ≤ N ≤ 10^5

1 ≤ K ≤ 10^9

1 ≤ Ai, Bi ≤ 10^9

SAMPLE INPUT
1
3 10
3 4 5
4 4 5

SAMPLE OUTPUT
12

Explanation

If David picks stones of first kind he can pick 3 stones, he will get a profit of 34 = 12 Rs.
If David picks stones of second kind he can pick 2 stones, he will get a profit of 24 = 8 Rs.
If David picks stones of third kind he can pick 2 stones, he will get a profit of 2*5 = 10 Rs.

So the maximum possible profit is 12.


t=eval(input())
for _ in range(t):
	n,k=list(map( int, input().split() ))
	a=list(map(int,input().split()))
	b=list(map(int,input().split()))
	maximum=0
	for i in range(n):
		profit=int(k/a[i])*b[i]
		if(profit>maximum):
			maximum=profit
	print(maximum)
	


for _ in range(int(input())):
	n,k=list(map(int,input().split()))
	stone=list(map(int,input().split()))
	rups=list(map(int,input().split()))
	max=0
	for i in range(n):
		d=k/stone[i]
		d=d*rups[i]
		if(d>max):
			max=d
	print(max)


j = int(input())
x=0
while(x<j):
	q = input().split()
	n = int(q[0])
	k = int(q[1])
	i = 0
	a = input().split()
	b = input().split()
	s = list()
	z = list()
	while(i<n):
		l = k / int(a[i])
		s.append(l)
		z.append(int(b[i])*s[i])
		i = i + 1
	print(max(z))
	x = x + 1