{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"\u003cdiv class\u003d\"panel_content\"\u003e\n Tauren has an integer sequence $A$ of length $n$ (1-based). He wants you to invert an interval $[l, r]$ $(1 \\leq l \\leq r \\leq n)$ of $A$ (i.e. replace $A_l, A_{l + 1}, \\cdots, A_r$ with $A_r, A_{r - 1}, \\cdots, A_l$) to maximize the length of the longest non-decreasing subsequence of $A$. Find that maximal length and any inverting way to accomplish that mission.\n \u003cbr\u003e\n A non-decreasing subsequence of $A$ with length $m$ could be represented as $A_{x_1}, A_{x_2}, \\cdots, A_{x_m}$ with $1 \\leq x_1 \u0026lt; x_2 \u0026lt; \\cdots \u0026lt; x_m \\leq n$ and $A_{x_1} \\leq A_{x_2} \\leq \\cdots \\leq A_{x_m}$.\n \u003cbr\u003e\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"MD","content":"The first line contains one integer $T$, indicating the number of test cases.\n\u003cbr\u003e\nThe following lines describe all the test cases. For each test case:\n\u003cbr\u003e\nThe first line contains one integer $n$.\n\u003cbr\u003e\nThe second line contains $n$ integers $A_1, A_2, \\cdots, A_n$ without any space.\n\u003cbr\u003e\n$1 \\leq T \\leq 100$, $1 \\leq n \\leq 10^5$, $0 \\leq A_i \\leq 9$ $(i \u003d 1, 2, \\cdots, n)$.\n\u003cbr\u003e\nIt is guaranteed that the sum of $n$ in all test cases does not exceed $2 \\cdot 10^5$.\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"MD","content":"For each test case, print three space-separated integers $m, l$ and $r$ in one line, where $m$ indicates the maximal length and $[l, r]$ indicates the relevant interval to invert.\n\u003cbr\u003e"}},{"title":"Sample","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\u003e2\n9\n864852302\n9\n203258468\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5 1 8\n6 1 2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"MD","content":"\u003cbr\u003e\nIn the first example, 864852302 after inverting [1, 8] is 032584682, one of the longest non-decreasing subsequences of which is 03588.\n\u003cbr\u003e\nIn the second example, 203258468 after inverting [1, 2] is 023258468, one of the longest non-decreasing subsequences of which is 023588.\n\u003cbr\u003e"}}]}