{"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":"PLAIN","content":"在一共可以使用魔法的世界里,入门考试是抓猪。\n抓每种猪用的魔法是不一样的,所以考核仅以抓猪的种类作为考核结果。\n每次考试的考试指南会 给出抓每种猪所需的法力值__Mana抓住这种猪能获得的分数__Score。\n有Times次考试,你每次考试时的用的猪的种类数__Types和魔力值__Have不同\n每次考试你都想在自己能用的魔力值的范围内得到最多的分数"}},{"title":"Input","value":{"format":"PLAIN","content":"输入模式\n第一行输入Times\n对于每组样例\n__Types __Have\n__Score(1) __Score(2) ------ __Score(__Types)\n__Mana(1) __Mana(2) ------ __Mana(__Types)"}},{"title":"Output","value":{"format":"PLAIN","content":"输出只有一共数字总分__SumOfScore"}},{"title":"Sample Input","value":{"format":"PLAIN","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":"PLAIN","content":"51"}}]}