{"trustable":false,"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":"\t\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n\t MathJax.Hub.Config({\n\t extensions: [\"tex2jax.js\"],\n\t jax: [\"input/TeX\", \"output/SVG\"],\n\t tex2jax: {\n\t inlineMath: [ [\u0027$\u0027,\u0027$\u0027], [\"\\\\(\",\"\\\\)\"] ],\n\t displayMath: [ [\u0027$$\u0027,\u0027$$\u0027], [\"\\\\[\",\"\\\\]\"] ],\n\t processEscapes: true\n\t },\n\t });\n\t\u003c/script\u003e\n\t\u003cscript type\u003d\"text/javascript\"\n\t src\u003d\"https://cdn.staticfile.org/mathjax/2.7.0/MathJax.js\"\u003e\n\t\u003c/script\u003e\n \n \u003c!--\n Problem text file for ZheJiang University Online Judge\n Created by LiuYaoting\n--\u003e \n \u003cp\u003e Recently, 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. \u003c/p\u003e \n \u003cp\u003e You are to write a program to make it most powerful, which means that the sum of power produced during all the collides is maximal. \u003c/p\u003e \n \u003cp\u003e\n题意:不超过10种气体,两两之间相互碰撞可以产生一定的能量,如a碰b,那么b气体就消失,自身不能碰自身,问最后所能得到的最大能量"}},{"title":"Input","value":{"format":"HTML","content":"\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e There 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. \u003c/p\u003e \n \u003cp\u003e The last case is followed by a 0 in one line. \u003c/p\u003e \n \u003cp\u003e There will be no more than 500 cases including no more than 50 large cases that N is 10. \u003c/p\u003e \n \u003cp\u003e\u003cb"}},{"title":"Output","value":{"format":"HTML","content":"\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e Output the maximal power these N atoms can produce in a line for each case. \u003c/p\u003e \n \u003cp\u003e\u003cb"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e 2\u003cbr\u003e 0 4\u003cbr\u003e 1 0\u003cbr\u003e 3\u003cbr\u003e 0 20 1\u003cbr\u003e 12 0 1\u003cbr\u003e 1 10 0\u003cbr\u003e 0\u003cbr\u003e \u003cbr\u003e \u003c/p\u003e \n \u003cp\u003e\u003cb"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e 4\u003cbr\u003e 22\u003cbr\u003e \u003c/p\u003e \n "}}]}