Given weights and values related to n items and the maximum capacity allowed for these items. What is the maximum value we can achieve if we can pick any weights any number of times for a total allowed weight of W?
The first line of input contains an integer denoting the number of test cases. Then T test cases follow . Each test case contains two integers N and W denoting the number of items and the total allowed weight. In the next two lines are space separated values of the array denoting values of the items (val) and their weights (wt) respectively.
For each test case, in a new line, print the maximum value which we can achieve if we can pick any weights any number of times for a bag of size W.
1 <= T <= 100
1 <= N, W <= 103
1 <= wt, val <= 100
1 4 5 7
1 3 4 5
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.