{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003csection\u003e \n \u003cp\u003eThere are \u003cvar\u003e\\(N\\)\u003c/var\u003e cities. The cost of travel from City \u003cvar\u003e\\(i\\)\u003c/var\u003e to City \u003cvar\u003e\\(j\\)\u003c/var\u003e is \u003cvar\u003e\\(C_{i, j}\\)\u003c/var\u003e coins.\u003c/p\u003e\n\u003cp\u003eSamer is living in city \u003cvar\u003e\\(1\\)\u003c/var\u003e, and he has K coins.\u003c/p\u003e \n \u003cp\u003eAmong all paths that start at City \u003cvar\u003e\\(1\\)\u003c/var\u003e, and visit all other cities exactly once, and then go back to City \u003cvar\u003e\\(1\\)\u003c/var\u003e, how many paths that cost \u003cb\u003eexactly\u003c/b\u003e \u003cvar\u003e\\(K\\)\u003c/var\u003e to travel along?\u003c/p\u003e\n\u003c/section\u003e"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003csection\u003e \n \u003cul\u003e \n \u003cli\u003e\u003cvar\u003e\\(2\\leq N \\leq 8\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003eIf \u003cvar\u003e\\(i\\neq j\\)\u003c/var\u003e, \u003cvar\u003e\\(1\\leq C_{i,j} \\leq 10^8\\)\u003c/var\u003e.\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(C_{i,i}\u003d0\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(C_{i,j}\u003dC_{j,i}\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1\\leq K \\leq 10^9\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003eAll values in input are integers.\u003c/li\u003e \n \u003c/ul\u003e \n\u003c/section\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003csection\u003e \n \u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e \n \u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e \u003cvar\u003e\\(K\\)\u003c/var\u003e\n\u003cvar\u003e\\(C_{1,1}\\)\u003c/var\u003e \u003cvar\u003e\\(\\ldots\\)\u003c/var\u003e \u003cvar\u003e\\(C_{1,N}\\)\u003c/var\u003e\n\u003cvar\u003e\\(\\vdots\\)\u003c/var\u003e\n\u003cvar\u003e\\(C_{N,1}\\)\u003c/var\u003e \u003cvar\u003e\\(\\ldots\\)\u003c/var\u003e \u003cvar\u003e\\(C_{N,N}\\)\u003c/var\u003e\n\u003c/pre\u003e \n\u003c/section\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003csection\u003e \n \u003cp\u003ePrint the answer as an integer.\u003c/p\u003e \n\u003c/section\u003e"}},{"title":"Sample 1","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 330\n0 1 10 100\n1 0 20 200\n10 20 0 300\n100 200 300 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e \n\u003c/section\u003e\u003csection\u003e \n \u003cp\u003eThere are six paths that start at City \u003cvar\u003e\\(1\\)\u003c/var\u003e, visit all other cities exactly once, and then go back to City \u003cvar\u003e\\(1\\)\u003c/var\u003e:\u003c/p\u003e \n \u003cul\u003e \n \u003cli\u003e\u003cvar\u003e\\(1\\to 2\\to 3\\to 4\\to 1\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1\\to 2\\to 4\\to 3\\to 1\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1\\to 3\\to 2\\to 4\\to 1\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1\\to 3\\to 4\\to 2\\to 1\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1\\to 4\\to 2\\to 3\\to 1\\)\u003c/var\u003e\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1\\to 4\\to 3\\to 2\\to 1\\)\u003c/var\u003e\u003c/li\u003e \n \u003c/ul\u003e \n \u003cp\u003eThe cost of travel along these paths are \u003cvar\u003e\\(421\\)\u003c/var\u003e, \u003cvar\u003e\\(511\\)\u003c/var\u003e, \u003cvar\u003e\\(330\\)\u003c/var\u003e, \u003cvar\u003e\\(511\\)\u003c/var\u003e, \u003cvar\u003e\\(330\\)\u003c/var\u003e, and \u003cvar\u003e\\(421\\)\u003c/var\u003e, respectively, among which two are exactly \u003cvar\u003e\\(330\\)\u003c/var\u003e.\u003c/p\u003e \n\u003c/section\u003e"}},{"title":"Sample 2","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\u003e5 5\n0 1 1 1 1\n1 0 1 1 1\n1 1 0 1 1\n1 1 1 0 1\n1 1 1 1 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e24\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003csection\u003e \n\u003c/section\u003e\u003csection\u003e \n \u003cp\u003eIn whatever order we visit the cities, it will cost \u003cvar\u003e\\(5\\)\u003c/var\u003e coins to travel.\u003c/p\u003e\n\u003c/section\u003e"}}]}