#abc183c. [abc183_c]Travel

[abc183_c]Travel

Problem Statement

There are NN cities. The time it takes to travel from City ii to City jj is Ti,jT_{i, j}.

Among those paths that start at City 11, visit all other cities exactly once, and then go back to City 11, how many paths take the total time of exactly KK to travel along?

Constraints

  • 2leqNleq82\\leq N \\leq 8
  • If ineqji\\neq j, 1leqTi,jleq1081\\leq T_{i,j} \\leq 10^8.
  • Ti,i=0T_{i,i}=0
  • Ti,j=Tj,iT_{i,j}=T_{j,i}
  • 1leqKleq1091\\leq K \\leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK T1,1T_{1,1} ldots\\ldots T1,NT_{1,N} vdots\\vdots TN,1T_{N,1} ldots\\ldots TN,NT_{N,N}

Output

Print the answer as an integer.


Sample Input 1

4 330
0 1 10 100
1 0 20 200
10 20 0 300
100 200 300 0

Sample Output 1

2

There are six paths that start at City 11, visit all other cities exactly once, and then go back to City 11:

  • 1to2to3to4to11\\to 2\\to 3\\to 4\\to 1
  • 1to2to4to3to11\\to 2\\to 4\\to 3\\to 1
  • 1to3to2to4to11\\to 3\\to 2\\to 4\\to 1
  • 1to3to4to2to11\\to 3\\to 4\\to 2\\to 1
  • 1to4to2to3to11\\to 4\\to 2\\to 3\\to 1
  • 1to4to3to2to11\\to 4\\to 3\\to 2\\to 1

The times it takes to travel along these paths are 421421, 511511, 330330, 511511, 330330, and 421421, respectively, among which two are exactly 330330.


Sample Input 2

5 5
0 1 1 1 1
1 0 1 1 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0

Sample Output 2

24

In whatever order we visit the cities, it will take the total time of 55 to travel.