{"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":"wbx有一天被楼妈下达了一个任务,是要在梆子井宿舍数人\u003cbr/\u003e\n梆子井一共有N个宿舍,每个宿舍的顺序就是他们的宿舍号\u003cbr/\u003e\n每个宿舍里面有Si个人(1\u003c\u003di\u003c\u003dn)。从第i到第j个宿舍一共有sum(i,j)\u003ds[i]+...+s[j]个人\u003cbr/\u003e\n一共有m个楼妈,每个楼妈都要找wbx数一次人,你的任务是找到sum(i1, j1) + ... + sum(im,jm)的最大值。且ix \u003c\u003d iy \u003c\u003djx和ix \u003c\u003d jy \u003c\u003djx的情况是不被允许的w。\u003cbr/\u003e\n注:1≤i≤n≤1e6,-32768≤Si≤32767"}},{"title":"Input","value":{"format":"HTML","content":"第一行输入m,n,后面跟着输入n个Si (1\u003c\u003di\u003c\u003dn)"}},{"title":"Output","value":{"format":"HTML","content":"输出最大和"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e1 3 1 2 3\n2 6 -1 4 -2 3 -2 3\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e6\n8 \n \u003ci style\u003d\"font-size:1px\"\u003e \u003c/i\u003e\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003e\nHuge input, scanf and dynamic programming is recommended.\n \u003c/pre\u003e"}}]}