{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"MD","content":"你有一个序列A[1],A[2],A[3]......,A[N]。\n每一组询问**l r**会询问**l到r的最大子段和**。\n给出M组询问,请正确地回答这些询问。"}},{"title":"Input","value":{"format":"MD","content":"第一行:给出一个整数N,表示你需要维护的序列的长度。\n第二行:给出N个整数,表示序列的初始状态。\n第三行:给出一个整数M,表示你需要回答询问的数量。\n第3+i行到3+M行:给出两个整数**L R**,表示询问L到R的最大子段和。"}},{"title":"Output","value":{"format":"MD","content":"M行,每行一个整数,表示**L**到**R**的最大字段和。"}},{"title":"","value":{"format":"MD","content":"## Example\n\n### Input\n```\n3 \n-1 2 3\n1\n1 2\n```\n### Output\n```\n2\n```"}},{"title":"Range","value":{"format":"MD","content":" |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000,保证L ≤ R。"}}]}