{"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":"为了活跃咱们CAS的氛围,伟大的贺超人决定举办一个欢快的火锅游戏。火锅游戏会持续n轮,每轮会放出最多m份某种美食,你在第x轮吃掉y份某种美食,就会得到a[x][y]的幸福度。在贺超人的火锅游戏中,你最多加起来能吃掉m份美食,请问你能得到的最大幸福度是多少?(某一轮可以选择不吃)"}},{"title":"Input","value":{"format":"HTML","content":"多组输入。\n每组数据第一行输入n,m。n是轮次,m是每轮的美食数以及你能吃的最大份数。\n接下来n行m列输入a矩阵。\na[x][y]代表幸福度,1\u003c\u003dx\u003c\u003dn\u003c\u003d100,1\u003c\u003dy\u003c\u003dm\u003c\u003d100。\nn\u003d0并且m\u003d0时结束多组输入。"}},{"title":"Output","value":{"format":"HTML","content":"对于每组数据,程序应该输出一行,为你将获得的最大幸福度。"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\n2 2\n1 2\n1 3\n2 2\n2 1\n2 1\n2 3\n3 2 1\n3 2 1\n0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\n3\n4\n6\u003c/pre\u003e"}}]}