{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n 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 … \n \u003cbr\u003eThe 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 ? \n \u003cbr\u003e \n \u003ccenter\u003e \n \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/0bf307b7a4c44236bd26a289041b24d5?v\u003d1599819388\"\u003e \n \u003c/center\u003e \n \u003cbr\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contain a integer T , the number of cases. \n\u003cbr\u003eFollowed by T cases , each case three lines , the first line contain two integer N , V, (N \u0026lt;\u003d 1000 , V \u0026lt;\u003d 1000 )representing the number of bones and the volume of his bag. And the second line contain N integers representing the volume of each bone. The third line contain N integers representing the value of each bone."}},{"title":"Output","value":{"format":"HTML","content":"One integer per line representing the maximum of the total value (this number will be less than 2\u003csup\u003e31\u003c/sup\u003e)."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e1\n5 10\n1 2 3 4 5\n5 4 3 2 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e14\u003c/pre\u003e"}}]}