{"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":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\tMany years ago , in Teddy\u0026rsquo;s hometown there was a man who was called \u0026ldquo;Bone Collector\u0026rdquo;. This man like to collect varies of bones , such as dog\u0026rsquo;s , cow\u0026rsquo;s , also he went to the grave \u0026hellip;\u003cbr /\u003e\r\n\tThe 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\u0026rsquo;s value along his trip , can you calculate out the maximum of the total value the bone collector can get ?\u003cbr /\u003e\r\n\t\u003ccenter\u003e\r\n\t\t\u003cimg src\u003d\"http://acm.hdu.edu.cn/../data/images/C154-1003-1.jpg\" /\u003e\u003c/center\u003e\r\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\tThe first line contain a integer T , the number of cases.\u003cbr /\u003e\r\n\tFollowed 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 value of each bone. The third line contain N integers representing the volume of each bone.\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\tOne integer per line representing the maximum of the total value (this number will be less than 2 \u003csup\u003e31\u003c/sup\u003e).\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\t\u003cpre\u003e\r\n\t\u003c/pre\u003e\r\n\t\u003cdiv style\u003d\"font-family:Courier New,Courier,monospace;\"\u003e\r\n\t\t\u003cpre\u003e\r\n\t\t1\r\n5 10\r\n1 2 3 4 5\r\n5 4 3 2 1 \u003c/pre\u003e\r\n\t\u003c/div\u003e\r\n\u003c/div\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\r\n\t\u003cpre\u003e\r\n\t\u003c/pre\u003e\r\n\t\u003cdiv style\u003d\"font-family:Courier New,Courier,monospace;\"\u003e\r\n\t\t\u003cpre\u003e\r\n\t\t14 \u003c/pre\u003e\r\n\t\u003c/div\u003e\r\n\u003c/div\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tBy AC_gsws\u003c/p\u003e"}}]}