{"raw_statement":[{"iden":"problem statement","content":"There are $N$ cities. The time it takes to travel from City $i$ to City $j$ is $T_{i, j}$.\nAmong those paths that start at City $1$, visit all other cities exactly once, and then go back to City $1$, how many paths take the total time of exactly $K$ to travel along?"},{"iden":"constraints","content":"*   $2\\leq N \\leq 8$\n*   If $i\\neq j$, $1\\leq T_{i,j} \\leq 10^8$.\n*   $T_{i,i}=0$\n*   $T_{i,j}=T_{j,i}$\n*   $1\\leq K \\leq 10^9$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$\n$T_{1,1}$ $\\ldots$ $T_{1,N}$\n$\\vdots$\n$T_{N,1}$ $\\ldots$ $T_{N,N}$"},{"iden":"sample input 1","content":"4 330\n0 1 10 100\n1 0 20 200\n10 20 0 300\n100 200 300 0"},{"iden":"sample output 1","content":"2\n\nThere are six paths that start at City $1$, visit all other cities exactly once, and then go back to City $1$:\n\n*   $1\\to 2\\to 3\\to 4\\to 1$\n*   $1\\to 2\\to 4\\to 3\\to 1$\n*   $1\\to 3\\to 2\\to 4\\to 1$\n*   $1\\to 3\\to 4\\to 2\\to 1$\n*   $1\\to 4\\to 2\\to 3\\to 1$\n*   $1\\to 4\\to 3\\to 2\\to 1$\n\nThe times it takes to travel along these paths are $421$, $511$, $330$, $511$, $330$, and $421$, respectively, among which two are exactly $330$."},{"iden":"sample input 2","content":"5 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"},{"iden":"sample output 2","content":"24\n\nIn whatever order we visit the cities, it will take the total time of $5$ to travel."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}