{"trustable":true,"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":"\n \u003cdiv style\u003d\"width:35.00%\" class\u003d\"illustration\"\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/7a939bcb6ae54b4c4ade1fbe1683d9f6?v\u003d1715477743\" alt\u003d\"/problems/oddgnome/file/statement/en/img-0001.jpg\" class\u003d\"illustration\"\u003e\n\n \n \u003c/div\u003e\n\n \u003cp\u003eAccording to the legend of Wizardry and Witchcraft, gnomes\n live in burrows underground, known as gnome holes. There they\n dig up and eat the roots of plants, creating little heaps of\n earth around gardens, causing considerable damage to them.\u003c/p\u003e\n\n \u003cp\u003eMrs. W, very annoyed by the damage, has to regularly\n de-gnome her garden by throwing the gnomes over the fence. It\n is a lot of work to throw them one by one because there are so\n many. Fortunately, the species is so devoted to their kings\n that each group always follows its king no matter what. In\n other words, if she were to throw just the king over the fence,\n all the other gnomes in that group would leave.\u003c/p\u003e\n\n \u003cp\u003eSo how does Mrs. W identify the king in a group of gnomes?\n She knows that gnomes travel in a certain order, and the king,\n being special, is always the only gnome who does not follow\n that order.\u003c/p\u003e\n\n \u003cp\u003eHere are some helpful tips about gnome groups:\u003c/p\u003e\n\n \u003cul class\u003d\"itemize\"\u003e\n \u003cli\u003e\n \u003cp\u003eThere is exactly one king in a group.\u003c/p\u003e\n \u003c/li\u003e\n\n \u003cli\u003e\n \u003cp\u003eExcept for the king, gnomes arrange themselves in\n strictly increasing ID order.\u003c/p\u003e\n \u003c/li\u003e\n\n \u003cli\u003e\n \u003cp\u003eThe king is always the only gnome out of that order.\u003c/p\u003e\n \u003c/li\u003e\n\n \u003cli\u003e\n \u003cp\u003eThe king is never the first nor the last in the group,\n because kings like to hide themselves.\u003c/p\u003e\n \u003c/li\u003e\n \u003c/ul\u003e\n\n \u003cp\u003eHelp Mrs. W by finding all the kings!\u003c/p\u003e\n\n \u003ch2\u003eInput\u003c/h2\u003e\n\n \u003cp\u003eThe input starts with an integer \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e, where \u003cspan class\u003d\"tex2jax_process\"\u003e$1 \\leq n \\leq 100$\u003c/span\u003e, representing the\n number of gnome groups. Each of the \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e following lines contains one group\n of gnomes, starting with an integer \u003cspan class\u003d\"tex2jax_process\"\u003e$g$\u003c/span\u003e, where \u003cspan class\u003d\"tex2jax_process\"\u003e$3 \\leq g \\leq 1\\, 000$\u003c/span\u003e, representing\n the number of gnomes in that group. Following on the same line\n are \u003cspan class\u003d\"tex2jax_process\"\u003e$g$\u003c/span\u003e space-separated\n integers, representing the gnome ordering. Within each group\n all the integers (including the king) are unique and in the\n range \u003cspan class\u003d\"tex2jax_process\"\u003e$[0,10\\, 000]$\u003c/span\u003e.\n Excluding the king, each integer is exactly one more than the\n integer preceding it.\u003c/p\u003e\n\n \u003ch2\u003eOutput\u003c/h2\u003e\n\n \u003cp\u003eFor each group, output the king’s position in the group\n (where the first gnome in line is number one).\u003c/p\u003e\n\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\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\u003e3\n7 1 2 3 4 8 5 6\n5 3 4 5 2 6\n4 10 20 11 12\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n4\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}