{"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":"Statement","value":{"format":"MD","content":"You have $n$ rare-stacks of blocks. The $i$-th rare-stack contains $a_i$ blocks. For your curiosity, **it\u0027s called rare-stack because it can hold negative number of blocks**.\n\nNow, you perform two kinds of operation on these rare-stacks:\n - $0 \\ \\ x \\ \\ y \\ - $ Change $a_x$ to $y$\n - $1 \\ \\ l \\ \\ r \\ - $ Find $\\max(a_i + a_{i+1} + a_{i+2} + \\dots + a_{j})$ where, $l \\leq i \\leq j \\leq r$\n\nYou also have to perform these operations for $m$ times."}},{"title":"Input","value":{"format":"MD","content":"The first line of input contains an integer $n \\ (1 \\leq n \\leq 50000)$.\n\nThe following line contains $n$ integers, representing the number of blocks of $i-$ th rare-stack $a_1, a_{i+1},a_{i+2}, \\dots, a_{n} \\ (|a_i| \\leq 10000)$,\n\nThe third line contains an integer $m \\ (1 \\leq m \\leq 50000)$.\n\nThe next $m$ lines contain the operations in one of the following form:\n\n - $0 \\ \\ x \\ \\ y \\ - $ Change $a_x \\ (1 \\leq x \\leq n)$ to $y \\ (|y| \\leq 10000)$\n - $1 \\ \\ l \\ \\ r \\ - $ Output $\\max(a_i + a_{i+1} + a_{i+2} + \\dots + a_{j}) \\ \\forall \\ ( 1 \\leq l \\leq i \\leq j \\leq r \\leq n)$\n"}},{"title":"Output","value":{"format":"MD","content":"For each of query type $1$, print the output in a new line."}},{"title":"Sample I/O","value":{"format":"MD","content":"\u003ctable class\u003d\"vjudge_sample\"\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\u003e\n4\n1 2 3 4\n4\n1 1 3\n0 3 -3\n1 2 4\n1 3 3\n\u003c/pre\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cpre\u003e\n6\n4\n-3\n\u003c/pre\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}