{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\nRecently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of power is produced. Researchers know the way every two atoms perform when collided and the power every two atoms can produce.\n\u003c/p\u003e\n\n\u003cp\u003e\nYou are to write a program to make it most powerful, which means that the sum of power produced during all the collides is maximal.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\nThere are multiple cases. The first line of each case has an integer N (2 \u0026lt;\u003d N \u0026lt;\u003d 10), which means there are N atoms: A\u003csub\u003e1\u003c/sub\u003e, A\u003csub\u003e2\u003c/sub\u003e, ... , A\u003csub\u003eN\u003c/sub\u003e. Then N lines follow. There are N integers in each line. The j-th integer on the i-th line is the power produced when A\u003csub\u003ei\u003c/sub\u003e and A\u003csub\u003ej\u003c/sub\u003e collide with A\u003csub\u003ej\u003c/sub\u003e gone. All integers are positive and not larger than 10000.\n\u003c/p\u003e\n\n\u003cp\u003e\nThe last case is followed by a 0 in one line.\n\u003c/p\u003e\n\u003cp\u003e\nThere will be no more than 500 cases including no more than 50 large cases that N is 10.\n\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\nOutput the maximal power these N atoms can produce in a line for each case.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eSample Input\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\n2\u003cbr\u003e\n0 4\u003cbr\u003e\n1 0\u003cbr\u003e\n3\u003cbr\u003e\n0 20 1\u003cbr\u003e\n12 0 1\u003cbr\u003e\n1 10 0\u003cbr\u003e\n0\u003cbr\u003e\n\u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eSample Output\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\n4\u003cbr\u003e\n22\u003cbr\u003e\n\u003c/p\u003e\n\n"}}]}