{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eGiven a n*n matrix C\u003csub\u003eij\u003c/sub\u003e (1\u0026lt;\u003di,j\u0026lt;\u003dn),We want to find a n*n matrix X\u003csub\u003eij\u003c/sub\u003e (1\u0026lt;\u003di,j\u0026lt;\u003dn),which is 0 or 1.\u003cbr\u003e\u003cbr\u003eBesides,X\u003csub\u003eij\u003c/sub\u003e meets the following conditions:\u003cbr\u003e\u003cbr\u003e 1.X\u003csub\u003e12\u003c/sub\u003e+X\u003csub\u003e13\u003c/sub\u003e+...X\u003csub\u003e1n\u003c/sub\u003e\u003d1\u003cbr\u003e 2.X\u003csub\u003e1n\u003c/sub\u003e+X\u003csub\u003e2n\u003c/sub\u003e+...X\u003csub\u003en-1n\u003c/sub\u003e\u003d1\u003cbr\u003e 3.for each i (1\u0026lt;i\u0026lt;n), satisfies ∑X\u003csub\u003eki\u003c/sub\u003e (1\u0026lt;\u003dk\u0026lt;\u003dn)\u003d∑X\u003csub\u003eij\u003c/sub\u003e (1\u0026lt;\u003dj\u0026lt;\u003dn).\u003cbr\u003e\u003cbr\u003eFor example, if n\u003d4,we can get the following equality:\u003cbr\u003e\u003cbr\u003e X\u003csub\u003e12\u003c/sub\u003e+X\u003csub\u003e13\u003c/sub\u003e+X\u003csub\u003e14\u003c/sub\u003e\u003d1\u003cbr\u003e X\u003csub\u003e14\u003c/sub\u003e+X\u003csub\u003e24\u003c/sub\u003e+X\u003csub\u003e34\u003c/sub\u003e\u003d1\u003cbr\u003e X\u003csub\u003e12\u003c/sub\u003e+X\u003csub\u003e22\u003c/sub\u003e+X\u003csub\u003e32\u003c/sub\u003e+X\u003csub\u003e42\u003c/sub\u003e\u003dX\u003csub\u003e21\u003c/sub\u003e+X\u003csub\u003e22\u003c/sub\u003e+X\u003csub\u003e23\u003c/sub\u003e+X\u003csub\u003e24\u003c/sub\u003e\u003cbr\u003e X\u003csub\u003e13\u003c/sub\u003e+X\u003csub\u003e23\u003c/sub\u003e+X\u003csub\u003e33\u003c/sub\u003e+X\u003csub\u003e43\u003c/sub\u003e\u003dX\u003csub\u003e31\u003c/sub\u003e+X\u003csub\u003e32\u003c/sub\u003e+X\u003csub\u003e33\u003c/sub\u003e+X\u003csub\u003e34\u003c/sub\u003e\u003cbr\u003e\u003cbr\u003eNow ,we want to know the minimum of ∑C\u003csub\u003eij\u003c/sub\u003e*X\u003csub\u003eij\u003c/sub\u003e(1\u0026lt;\u003di,j\u0026lt;\u003dn) you can get.\u003cbr\u003e\u003cdiv style\u003d\"font-family:Times New Roman;font-size:14px;background-color:F4FBFF;border:#B7CBFF 1px dashed;padding:6px\"\u003e\u003cdiv style\u003d\"font-family:Arial;font-weight:bold;color:#7CA9ED;border-bottom:#B7CBFF 1px dashed\"\u003e\u003ci\u003eHint\u003c/i\u003e\u003c/div\u003e\u003cbr\u003eFor sample, X\u003csub\u003e12\u003c/sub\u003e\u003dX\u003csub\u003e24\u003c/sub\u003e\u003d1,all other X\u003csub\u003eij\u003c/sub\u003e is 0.\u003cbr\u003e\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input consists of multiple test cases (less than 35 case).\u003cbr\u003eFor each test case ,the first line contains one integer n (1\u0026lt;n\u0026lt;\u003d300).\u003cbr\u003eThe next n lines, for each lines, each of which contains n integers, illustrating the matrix C, The j-th integer on i-th line is C\u003csub\u003eij\u003c/sub\u003e(0\u0026lt;\u003dC\u003csub\u003eij\u003c/sub\u003e\u0026lt;\u003d100000)."}},{"title":"Output","value":{"format":"HTML","content":"For each case, output the minimum of ∑C\u003csub\u003eij\u003c/sub\u003e*X\u003csub\u003eij\u003c/sub\u003e you can get.\u003cbr\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\n1 2 4 10\r\n2 0 1 1\r\n2 2 0 5\r\n6 3 1 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}