{"trustable":true,"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":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003eYou are given a sequence of N integers A\u003csub\u003e1\u003c/sub\u003e, A\u003csub\u003e2\u003c/sub\u003e ... A\u003csub\u003eN\u003c/sub\u003e. (-10000 \u0026lt;\u003d A\u003csub\u003ei\u003c/sub\u003e \u0026lt;\u003d 10000, N \u0026lt;\u003d 50000)\r\n\u003c/p\u003e\r\n\u003cp\u003eLet S\u003csub\u003ei\u003c/sub\u003e denote the sum of A\u003csub\u003e1\u003c/sub\u003e ... A\u003csub\u003ei\u003c/sub\u003e. You need to apply M (M \u0026lt;\u003d 50000) operations:\r\n\u003c/p\u003e\r\n\r\n\u003cul\u003e\r\n\u003cli\u003e0 x y k: increase all integers from A\u003csub\u003ex\u003c/sub\u003e to A\u003csub\u003ey\u003c/sub\u003e by k (1 \u0026lt;\u003d x \u0026lt;\u003d y \u0026lt;\u003d N, -10000 \u0026lt;\u003d k \u0026lt;\u003d 10000).\r\n\u003c/li\u003e\u003cli\u003e1 x y: ask for max{ S\u003csub\u003ei\u003c/sub\u003e | x \u0026lt;\u003d i \u0026lt;\u003d y }.(1 \u0026lt;\u003d x \u0026lt;\u003d y \u0026lt;\u003d N)\r\n\u003c/li\u003e\u003c/ul\u003e\r\n\r\n\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eIn the first line there is an integer N.\r\n\u003c/li\u003e\u003cli\u003eThe following line contains N integers that represent the sequence.\r\n\u003c/li\u003e\u003cli\u003eThe third line contains an integer M denotes the number of operations.\r\n\u003c/li\u003e\u003cli\u003eIn the next M lines, each line contains an operation \"0 x y k\" or \"1 x y\".\r\n\u003c/li\u003e\u003c/ul\u003e\r\n\r\n\r\n\u003ch3\u003eOutput\u003c/h3\u003e\t\r\n\u003cp\u003eFor each \"1 x y\" operation, print one integer representing its result.\r\n\u003c/p\u003e\r\n\r\n\r\n\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\r\n\u003cdiv\u003e\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\u003e5\r\n238 -9622 5181 202 -6943\r\n5\r\n1 3 4\r\n0 5 5 4846\r\n1 3 5\r\n0 3 5 -7471\r\n1 3 3\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-4001\r\n-4001\r\n-11674\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\r\n\r\n\u003cp\u003e\u003cb\u003eUse signed 64-bit integer :)\u003c/b\u003e\u003c/p\u003e\n\u003c/div\u003e"}}]}