{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"In the newest census of Jersey Cows and Holstein Cows, Wisconsin cows have earned three stalls in the Barn of Representatives. The Jersey Cows currently control the state\u0027s redistricting committee. They want to partition the state into three equally sized voting districts such that the Jersey Cows are guaranteed to win elections in at least two of the districts.\r\u003cbr\u003e\r\u003cbr\u003eWisconsin has 3*K (1 \u0026lt;\u003d K \u0026lt;\u003d 60) cities of 1,000 cows, numbered 1..3*K, each with a known number (range: 0..1,000) of Jersey Cows. Find a way to partition the state into three districts, each with K cities, such that the Jersey Cows have the majority percentage in at least two of districts.\r\u003cbr\u003e\r\u003cbr\u003eAll supplied input datasets are solvable."}},{"title":"Input","value":{"format":"HTML","content":"* Line 1: A single integer, K\r\u003cbr\u003e\r\u003cbr\u003e* Lines 2..3*K+1: One integer per line, the number of cows in each city that are Jersey Cows. Line i+1 contains city i\u0027s cow census."}},{"title":"Output","value":{"format":"HTML","content":"* Lines 1..K: K lines that are the city numbers in district one, one per line\r\u003cbr\u003e\r\u003cbr\u003e* Lines K+1..2K: K lines that are the city numbers in district two, one per line\r\u003cbr\u003e\r\u003cbr\u003e* Lines 2K+1..3K: K lines that are the city numbers in district three, one per line"}},{"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\u003e2\r\n510\r\n500\r\n500\r\n670\r\n400\r\n310\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n2\r\n3\r\n6\r\n5\r\n4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"Other solutions might be possible. Note that \"2 3\" would NOT be a district won by the Jerseys, as they would be exactly half of the cows."}}]}