{"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\u003cscript\u003e window.katexOptions \u003d { disable: true }; \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\u003c/script\u003e","sections":[{"title":"题目描述","value":{"format":"MD","content":"你被给予一个循环数组 $a_0, a_1, ..., a_{n-1}$。它有两种操作:\n\n- $inc(lf, rg, v)$ —— 这个操作会将区间 $[lf, rg]$(包含端点)内的每个元素增加 $v$。\n- $rmq(lf, rg)$ —— 这个操作会返回区间 $[lf, rg]$(包含端点)内的最小值。\n\n假设区间是循环的,所以如果 $n \u003d 5$ 并且 $lf \u003d 3, rg \u003d 1$,那么意味着索引序列是:$3, 4, 0, 1$。\n\n编写程序来处理给定的操作序列。"}},{"title":"输入格式","value":{"format":"MD","content":"第一行包含整数 $n$ ($1 \\leq n \\leq 200000$)。\n\n下一行包含数组的初始状态:$a_0, a_1, ..., a_{n-1}$ ($-10^6 \\leq a_i \\leq 10^6$),$a_i$ 是整数。\n\n第三行包含整数 $m$ ($0 \\leq m \\leq 200000$),$m$ 是操作数。\n\n接下来的 $m$ 行每行包含一个操作。\n\n如果行包含两个整数 $lf, rg$ ($0 \\leq lf, rg \\leq n - 1$),则表示 $rmq$ 操作,如果包含三个整数 $lf, rg, v$ ($0 \\leq lf, rg \\leq n - 1; -10^6 \\leq v \\leq 10^6$),则表示 $inc$ 操作。"}},{"title":"输出格式","value":{"format":"MD","content":"对于每个 $rmq$ 操作,写下它的结果。"}},{"title":"样例 #1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n1 2 3 4\n4\n3 0\n3 0 -1\n0 1\n2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n0\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}