{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003ePumba, the warthog, has found a sequence \u003cspan class\u003d\"tex2jax_process\"\u003e$S$\u003c/span\u003e of \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e integers from the range \u003cspan class\u003d\"tex2jax_process\"\u003e$[1, T]$\u003c/span\u003e. As a\nvery inquisitive warthog, he has \u003cspan class\u003d\"tex2jax_process\"\u003e$M$\u003c/span\u003e peculiar queries he would like to compute. There are two types of queries: The first type modifies a number in \u003cspan class\u003d\"tex2jax_process\"\u003e$S$\u003c/span\u003e to a different value from the same range. The second type computes the length of the currently shortest contiguous sequence in \u003cspan class\u003d\"tex2jax_process\"\u003e$S$\u003c/span\u003e that contains all the numbers from the interval \u003cspan class\u003d\"tex2jax_process\"\u003e$[1, T]$\u003c/span\u003e.\u003c/p\u003e\n\n\u003ch2\u003eInput\u003c/h2\u003e \n\n\u003cp\u003eThe first line contains the integers \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq N \\leq 10^5$\u003c/span\u003e), \u003cspan class\u003d\"tex2jax_process\"\u003e$T$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq T \\leq 50$\u003c/span\u003e) and \u003cspan class\u003d\"tex2jax_process\"\u003e$M$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq M \\leq 10^5$\u003c/span\u003e).\u003c/p\u003e\n\n\u003cp\u003eThe second line contains the \u003cspan class\u003d\"tex2jax_process\"\u003e$N$\u003c/span\u003e integers from the original sequence \u003cspan class\u003d\"tex2jax_process\"\u003e$S$\u003c/span\u003e.\u003c/p\u003e\n\n\u003cp\u003eThe following \u003cspan class\u003d\"tex2jax_process\"\u003e$M$\u003c/span\u003e lines describe the queries: \u003c/p\u003e\n\u003cul class\u003d\"itemize\"\u003e \n\t\u003cli\u003e \u003cp\u003e \"1 a b\" - change the value of the a-th (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq a \\leq N$\u003c/span\u003e) number into b (\u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq b \\leq T$\u003c/span\u003e).\u003c/p\u003e \u003c/li\u003e\n\t\u003cli\u003e \u003cp\u003e \"2\" - print the length of the shortest contiguous sequence containing all the integers from 1 to \u003cspan class\u003d\"tex2jax_process\"\u003e$T$\u003c/span\u003e. \u003c/p\u003e \u003c/li\u003e\n\u003c/ul\u003e\n \n\u003ch2\u003eOutput\u003c/h2\u003e \n\u003cp\u003eThe output consists of the answers to the second type of queries, each on a separate line. If there is no valid answer, output \u003cspan class\u003d\"tex2jax_process\"\u003e$-1$\u003c/span\u003e.\u003c/p\u003e\n\n\u003ctable class\u003d\"sample\" summary\u003d\"sample data\"\u003e \n \u003ctbody\u003e\n \u003ctr\u003e \n \u003cth\u003eSample Input 1\u003c/th\u003e \n \u003cth\u003eSample Output 1\u003c/th\u003e \n \u003c/tr\u003e \n \u003ctr\u003e \n \u003ctd\u003e \u003cpre\u003e4 3 6\n1 2 3 2\n1 4 1\n2\n1 3 2\n2\n1 1 3\n2\n\u003c/pre\u003e \u003c/td\u003e \n \u003ctd\u003e \u003cpre\u003e3\n-1\n4\n\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003c/tbody\u003e\n\u003c/table\u003e \n\u003ctable class\u003d\"sample\" summary\u003d\"sample data\"\u003e \n \u003ctbody\u003e\n \u003ctr\u003e \n \u003cth\u003eSample Input 2\u003c/th\u003e \n \u003cth\u003eSample Output 2\u003c/th\u003e \n \u003c/tr\u003e \n \u003ctr\u003e \n \u003ctd\u003e \u003cpre\u003e6 3 6\n3 1 2 1 3 3\n2\n1 2 3\n2\n1 4 3\n1 6 1\n2\n\u003c/pre\u003e \u003c/td\u003e \n \u003ctd\u003e \u003cpre\u003e3\n3\n4\n\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003c/tbody\u003e\n\u003c/table\u003e"}}]}