{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\nLittle Sub has a sequence $A_1,A_2,\\dots,A_N$. Now he has a problem for you.\n\u003c/p\u003e\n\u003cp\u003e\nTwo sequences $X_1, X_2, \\dots, X_u$ of length $u$ and $Y_1, Y_2, \\dots, Y_v$ of length $v$ are considered isomorphic when they meet all the following two conditions:\n\u003c/p\u003e\u003col\u003e\n \u003cli\u003e$u \u003d v$;\u003c/li\u003e\n \u003cli\u003eDefine $\\text{occ}(S,k)$ as the number of times integer $k$ occur in sequence $S$. For each integer $k$ in $[1, 10^9]$, $\\text{occ}(X,k)\u003d\\text{occ}(Y,k)$ always holds.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003e\u003c/p\u003e\r\n\n\u003cp\u003e\r\nNow we have $M$ operations for $A$. and there are two kinds of operations:\n\u003c/p\u003e\u003cul\u003e\n \u003cli\u003e\u003ci\u003e1 x y\u003c/i\u003e: Change $A_x$ to $y$ ($1 \\le x \\le N$, $1 \\le y \\le 10^9$);\u003c/li\u003e\n \u003cli\u003e\u003ci\u003e2\u003c/i\u003e: Query for the greatest $k$ ($1 \\leq k \\leq N-1$) that there exist two integers $i$ and $j$ ($1 \\leq i \\lt j \\leq N-k+1$) and $A_i, A_{i+1}, \\dots, A_{i+k-1}$ is isomorphic with $A_j, A_{j+1}, \\dots, A_{j+k-1}$. Specially, if there is no such $k$, please output \"-1\" (without quotes) instead.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003c/p\u003e\r\n\r\n\u003ch4\u003eInput\u003c/h4\u003e\r\n\u003cp\u003e\nThere are multiple test cases. The first line of the input contains an integer $T$ ($1 \\le T \\le 5$), indicating the number of test cases. For each test case:\n\u003c/p\u003e\n\u003cp\u003e\r\nThe first line ontains two integers $N,M \\ (1 \\le N \\le 10^5, 1 \\le M \\le 10^5)$. \n\u003c/p\u003e\n\u003cp\u003e\nThe second line contains $N$ integers $A_1, A_2, \\dots, A_N$ ($1 \\le A_i \\le 10^9$).\n\u003c/p\u003e\n\u003cp\u003e\nIn the following $M$ lines, each line contains one operation. The format is described above.\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eOutput\u003c/h4\u003e\r\n\u003cp\u003e\r\nFor each operation 2, output one line containing the answer.\r\n\u003c/p\u003e\r\n\r\n\u003ch4\u003eSample\u003c/h4\u003e\n\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\u003e1\r\n3 5\r\n1 2 3\r\n2\r\n1 3 2\r\n2\r\n1 1 2\r\n2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1\r\n1\r\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n"}}]}