{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n disable: true\n };\n\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\n","sections":[{"title":"题目","value":{"format":"MD","content":"昊昊喜欢吃糖果,他有很多糖果,他把那些糖果分成两份排成两个序列,现在他想把这两个序列合并成一个,并且保证原来同组内的糖果相对顺序不变,现在定义序列的权值为:\n\n F(a) \u003d max(0, a1, (a1+a2), (a1+a2+a3), ..... , (a1+a2+a3+⋯+a(n+m)))\n\n请你帮助昊昊找出合并后最大的权值。"}},{"title":"输入","value":{"format":"MD","content":"第一行输入,表示有t组数据。\n接下来t组数据分别输入s1和s1个数字表示第一个序列,s2和s2个数字表示第二个序列。\nt(1≤t≤1000), (1≤s1,s2≤100), (−100≤序列数字大小≤100)"}},{"title":"输出","value":{"format":"MD","content":"输出两个序列合并后的最大权值。"}},{"title":"样例","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n4\n6 -5 7 -3\n3\n2 3 -4\n2\n1 1\n4\n10 -3 2 2\n5\n-1 -2 -3 -4 -5\n5\n-1 -2 -3 -4 -5\n1\n0\n1\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e13\n13\n0\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"提示","value":{"format":"MD","content":"1.第一组把序列合并成[6,2,−5,3,7,−3,−4]可得到最大权值13。\n2.第二组合并成[10,1,−3,1,2,2]得到最大权值13。\n3.第三组合并成[−1,−1,−2,−3,−2,−4,−5,−3,−4,−5] 由于都是负数,所以取0.\n4.很明显第四组合并后为0."}}]}