2563: 骨头收集者

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:16 Solved:6

Description

“骨头收集者”带着体积为v的背包去贱骨头,已知每个骨头的体积和价值,求能装进背包的最大价值。


Input

第一行是测试数量
第二行是骨头数量和背包体积
第三行是每个骨头的价值
第四行是每个骨头的体积

Output

最大价值

Sample Input Copy

1
5 10
1 2 3 4 5
5 4 3 2 1

Sample Output Copy

14

HINT

n<=1000,v<=1000.

Source/Category