{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\u003cp\u003eIn this problem, you are given a sequence \u003ci\u003eS\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003eS\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e, ..., \u003ci\u003eS\u003csub\u003en\u003c/sub\u003e\u003c/i\u003e of squares of different sizes. The sides of the squares are integer numbers. We locate the squares on the positive \u003ci\u003ex\u003c/i\u003e-\u003ci\u003ey\u003c/i\u003e quarter of the plane, such that their sides make 45 degrees with \u003ci\u003ex\u003c/i\u003e and \u003ci\u003ey\u003c/i\u003e axes, and one of their vertices are on \u003ci\u003ey\u003c/i\u003e\u003d0 line. Let \u003ci\u003eb\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e be the \u003ci\u003ex\u003c/i\u003e coordinates of the bottom vertex of \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e. First, put \u003ci\u003eS\u003csub\u003e1\u003c/sub\u003e\u003c/i\u003e such that its left vertex lies on \u003ci\u003ex\u003c/i\u003e\u003d0. Then, put \u003ci\u003eS\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, (\u003ci\u003ei\u003c/i\u003e \u0026gt; 1) at minimum \u003ci\u003eb\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e such that \u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ci\u003eb\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e \u0026gt; \u003ci\u003eb\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e\u003csub\u003e-1\u003c/sub\u003e and\u003c/li\u003e\u003cli\u003ethe interior of \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e does not have intersection with the interior of \u003ci\u003eS\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e...\u003ci\u003eS\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e-1\u003c/sub\u003e.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003c/p\u003e\u003ccenter\u003e\u003cimg src\u003d\"CDN_BASE_URL/628f7472da2cc4b643149a7d2695ae0c?v\u003d1714880294\"\u003e\u003c/center\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eThe goal is to find which squares are visible, either entirely or partially, when viewed from above. In the example above, the squares \u003ci\u003eS\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003eS\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e, and \u003ci\u003eS\u003c/i\u003e\u003csub\u003e4\u003c/sub\u003e have this property. More formally, \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e is visible from above if it contains a point \u003ci\u003ep\u003c/i\u003e, such that no square other than \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e intersect the vertical half-line drawn from \u003ci\u003ep\u003c/i\u003e upwards. \u003c/p\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input consists of multiple test cases. The first line of each test case is \u003ci\u003en\u003c/i\u003e (1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 50), the number of squares. The second line contains \u003ci\u003en\u003c/i\u003e integers between 1 to 30, where the \u003ci\u003ei\u003c/i\u003eth number is the length of the sides of \u003ci\u003eS\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e. The input is terminated by a line containing a zero number.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, output a single line containing the index of the visible squares in the input sequence, in ascending order, separated by blank characters.\u003c/p\u003e"}},{"title":"Sample","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\u003e4\r\n3 5 1 4\r\n3\r\n2 1 2\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2 4\r\n1 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}