{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eSo the Beautiful Regional Contest (BeRC) has come to an end! $$$n$$$ students took part in the contest. The final standings are already known: the participant in the $$$i$$$-th place solved $$$p_i$$$ problems. Since the participants are primarily sorted by the number of solved problems, then $$$p_1 \\ge p_2 \\ge \\dots \\ge p_n$$$.\u003c/p\u003e\u003cp\u003eHelp the jury distribute the gold, silver and bronze medals. Let their numbers be $$$g$$$, $$$s$$$ and $$$b$$$, respectively. Here is a list of requirements from the rules, which all must be satisfied:\u003c/p\u003e\u003cul\u003e \u003cli\u003e for each of the three types of medals, at least one medal must be awarded (that is, $$$g\u0026gt;0$$$, $$$s\u0026gt;0$$$ and $$$b\u0026gt;0$$$); \u003c/li\u003e\u003cli\u003e the number of gold medals must be strictly less than the number of silver and the number of bronze (that is, $$$g\u0026lt;s$$$ and $$$g\u0026lt;b$$$, but there are no requirements between $$$s$$$ and $$$b$$$); \u003c/li\u003e\u003cli\u003e each gold medalist must solve strictly more problems than any awarded with a silver medal; \u003c/li\u003e\u003cli\u003e each silver medalist must solve strictly more problems than any awarded a bronze medal; \u003c/li\u003e\u003cli\u003e each bronze medalist must solve strictly more problems than any participant not awarded a medal; \u003c/li\u003e\u003cli\u003e the total number of medalists $$$g+s+b$$$ should not exceed half of all participants (for example, if $$$n\u003d21$$$, then you can award a maximum of $$$10$$$ participants, and if $$$n\u003d26$$$, then you can award a maximum of $$$13$$$ participants). \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThe jury wants to reward with medals the total \u003cspan class\u003d\"tex-font-style-bf\"\u003emaximal\u003c/span\u003e number participants (i.e. to maximize $$$g+s+b$$$) so that all of the items listed above are fulfilled. Help the jury find such a way to award medals.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains an integer $$$t$$$ ($$$1 \\le t \\le 10000$$$) — the number of test cases in the input. Then $$$t$$$ test cases follow.\u003c/p\u003e\u003cp\u003eThe first line of a test case contains an integer $$$n$$$ ($$$1 \\le n \\le 4\\cdot10^5$$$) — the number of BeRC participants. The second line of a test case contains integers $$$p_1, p_2, \\dots, p_n$$$ ($$$0 \\le p_i \\le 10^6$$$), where $$$p_i$$$ is equal to the number of problems solved by the $$$i$$$-th participant from the final standings. The values $$$p_i$$$ are sorted in non-increasing order, i.e. $$$p_1 \\ge p_2 \\ge \\dots \\ge p_n$$$.\u003c/p\u003e\u003cp\u003eThe sum of $$$n$$$ over all test cases in the input does not exceed $$$4\\cdot10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint $$$t$$$ lines, the $$$j$$$-th line should contain the answer to the $$$j$$$-th test case.\u003c/p\u003e\u003cp\u003eThe answer consists of three non-negative integers $$$g, s, b$$$.\u003c/p\u003e\u003cul\u003e \u003cli\u003e Print $$$g\u003ds\u003db\u003d0$$$ if there is no way to reward participants with medals so that all requirements from the statement are satisfied at the same time. \u003c/li\u003e\u003cli\u003e Otherwise, print three positive numbers $$$g, s, b$$$ — the possible number of gold, silver and bronze medals, respectively. The sum of $$$g+s+b$$$ should be the maximum possible. If there are several answers, print any of them. \u003c/li\u003e\u003c/ul\u003e"}},{"title":"Examples","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\u003e5\n12\n5 4 4 3 2 2 1 1 1 1 1 1\n4\n4 3 2 1\n1\n1000000\n20\n20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1\n32\n64 64 63 58 58 58 58 58 37 37 37 37 34 34 28 28 28 28 28 28 24 24 19 17 17 17 17 16 16 16 16 11\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2 3\n0 0 0\n0 0 0\n2 5 3\n2 6 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, it is possible to reward $$$1$$$ gold, $$$2$$$ silver and $$$3$$$ bronze medals. In this case, the participant solved $$$5$$$ tasks will be rewarded with the gold medal, participants solved $$$4$$$ tasks will be rewarded with silver medals, participants solved $$$2$$$ or $$$3$$$ tasks will be rewarded with bronze medals. Participants solved exactly $$$1$$$ task won\u0027t be rewarded. It\u0027s easy to see, that in this case, all conditions are satisfied and it is possible to reward participants in this way. It is impossible to give more than $$$6$$$ medals because the number of medals should not exceed half of the number of participants. The answer $$$1$$$, $$$3$$$, $$$2$$$ is also correct in this test case.\u003c/p\u003e\u003cp\u003eIn the second and third test cases, it is impossible to reward medals, because at least one medal of each type should be given, but the number of medals should not exceed half of the number of participants.\u003c/p\u003e"}}]}