Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave …
The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lot of bones , obviously , different bone has different value and different volume, now given the each bone’s value along his trip , can you calculate out the maximum of the total value the bone collector can get ?
Input
The first line contain a integer T , the number of cases.
Followed by T cases , each case three lines , the first line contain two integer N , V, (N <= 1000 , V <= 1000 )representing the number of bones and the volume of his bag. And the second line contain N integers representing the value of each bone. The third line contain N integers representing the volume of each bone.
Output
One integer per line representing the maximum of the total value (this number will be less than 2^31).
译文:
很多年前,在泰迪的家乡有一个人被称为“骨头收藏家”。这个人喜欢收集各种各样的骨头,如狗的,牛的,他还去了坟墓…
骨收藏家有一个体积为V的大袋子,他收集的路上有很多骨头,显然,不同的骨头有不同的价值和体积,现在给出他收集的每一根骨头的价值,你能计算出骨头收藏家能得到的总价值的最大值吗?
输入
第一行包含一个整数T,即案例数。
接下来是T箱,每箱三行,第一行包含两个整数N,V,(N<=1000,V<=1000),代表骨头的数量和包的体积。第二行包含N个整数,表示每个骨骼的值。第三行包含N个整数,表示每个骨骼的体积。 输出
每行一个整数,表示总值的最大值(这个数字将小于2^31)。
Sample Input
1
5 10
1 2 3 4 5
5 4 3 2 1
Sample Output
14
#in