{"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":"You are given a sequence $A$ of $N \\ (N \\le 50 \\ 000)$ integers between $-10 \\ 000$ and $10 \\ 000$. On this sequence you have to apply $M \\ (M \\le 50 \\ 000)$ operations: modify the $i$-th element in the sequence, or for given $x, y$, print $\\max_{x \\le i \\le j \\le y} (A_i + A_{i+1} + \\cdots + A_j)$.\n\n \u003ch3\u003eInput\u003c/h3\u003e\n\nThe first line of input contains an integer $N$.\nThe following line contains $N$ integers, representing the sequence $A_1, A_2, \\dots, A_N$.\nThe third line contains an integer $M$. The next $M$ lines contain the operations in the following form:\n- $0 \\ x \\ y$: modify $A_x$ into $y \\ (|y| \\le 10 \\ 000)$.\n- $1 \\ x \\ y$: print $\\max_{x \\le i \\le j \\le y} (A_i + A_{i+1} + \\cdots + A_j)$.\n\n \u003ch3\u003eOutput\u003c/h3\u003e\n\nFor each query, print an integer as the problem required.\n\n \u003ch3\u003eExample\u003c/h3\u003e\n\n \u003cpre\u003e\n\u003cb\u003eInput:\u003c/b\u003e\n4\n1 2 3 4\n4\n1 1 3\n0 3 -3\n1 2 4\n1 3 3\n\n\u003cb\u003eOutput:\u003c/b\u003e\n6\n4\n-3\n\u003c/pre\u003e\n\u003c/div\u003e"}}]}