{"trustable":true,"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":"HTML","content":"\u003cp\u003e给定一个由 $$$n$$$ 个整数组成的数组 $$$a$$$。\u003c/p\u003e\u003cp\u003e令 $$$min(l, r)$$$ 为 $$$a_l, a_{l + 1}, \\ldots, a_r$$$ 中的最小值,$$$max(l, r)$$$ 为 $$$a_l, a_{l + 1}, \\ldots, a_r$$$ 中的最大值。\u003c/p\u003e\u003cp\u003e你的任务是选择三个 \u003cspan class\u003d\"tex-font-style-bf\"\u003e正整数\u003c/span\u003e(大于 $$$0$$$)$$$x$$$、$$$y$$$ 和 $$$z$$$,使得:\u003c/p\u003e\u003cul\u003e \u003cli\u003e $$$x + y + z \u003d n$$$;\u003c/li\u003e\u003cli\u003e $$$max(1, x) \u003d min(x + 1, x + y) \u003d max(x + y + 1, n)$$$。\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e换句话说,你需要将数组 $$$a$$$ 分成三个连续的非空部分,覆盖整个数组,并且第一部分的最大值等于第二部分的最小值,第二部分的最小值等于第三部分的最大值(或确定无法找到这样的分割)。\u003c/p\u003e\u003cp\u003e在所有这样的三元组(分割)中,你可以选择任意一个。\u003c/p\u003e\u003cp\u003e你需要回答 $$$t$$$ 个独立的测试用例。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入的第一行包含一个整数 $$$t$$$($$$1 \\le t \\le 2 \\cdot 10^4$$$) — 测试用例的数量。接下来有 $$$t$$$ 个测试用例。\u003c/p\u003e\u003cp\u003e每个测试用例的第一行包含一个整数 $$$n$$$($$$3 \\le n \\le 2 \\cdot 10^5$$$) — 数组 $$$a$$$ 的长度。\u003c/p\u003e\u003cp\u003e每个测试用例的第二行包含 $$$n$$$ 个整数 $$$a_1, a_2, \\ldots, a_n$$$($$$1 \\le a_i \\le 10^9$$$),其中 $$$a_i$$$ 是 $$$i$$$ 中的第 $$$a$$$ 个元素。\u003c/p\u003e\u003cp\u003e保证 $$$n$$$ 的总和不超过 $$$2 \\cdot 10^5$$$($$$\\sum n \\le 2 \\cdot 10^5$$$)。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,输出答案:如果不存在满足问题描述条件的 $$$a$$$ 的分割,则在一行中输出 \u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e。否则,在第一行输出 \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e,在第二行输出三个整数 $$$x$$$、$$$y$$$ 和 $$$z$$$($$$x + y + z \u003d n$$$)。\u003c/p\u003e\u003cp\u003e如果有多个答案,你可以输出任意一个。\u003c/p\u003e"}},{"title":"示例","value":{"format":"HTML","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\u003e6\n11\n1 2 3 3 3 4 4 3 4 2 1\n8\n2 9 1 7 3 9 4 1\n9\n2 1 4 2 4 3 3 1 2\n7\n4 2 1 1 4 1 4\n5\n1 1 1 1 1\n7\n4 3 4 3 3 3 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n6 1 4\nNO\nYES\n2 5 2\nYES\n4 1 2\nYES\n1 1 3\nYES\n2 1 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}