{"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":"MD","content":"现在我们有N个种类的食物,它们有不同的售价和能量. 但是Sunny手上的钱是有限的。在这个弱肉强食的世界,Sunny想要变强,因此需要能量升级,才能在这个世界上生存,为了让Sunny能够干掉更多等级低下的Boss,聪明的你帮帮Sunny怎样去获取能量?"}},{"title":"Input","value":{"format":"MD","content":"输入的第一行是T, 表示有T组数据。 \n每组数据由三行组成. \n第一行包含两个整数N和M(N \u003c\u003d 1000, V \u003c\u003d 1000). \nN表示食物的种类,M表示Sunny手上的钱(系统会更新嘛). \n第二行包含N个整数, 表示每个种类食物的售价。\n第三行包含N个整数, 表示每个种类食物的能量. "}},{"title":"Output","value":{"format":"MD","content":"对每一组数据, 输出你为Sunny去获取的能量。"}},{"title":"Sample Input","value":{"format":"MD","content":"1\n10 10\n1 3 5 7 9 11 13 15 17 19\n19 17 15 13 11 9 7 5 3 1"}},{"title":"Sample Output","value":{"format":"MD","content":"51"}}]}