![]() |
||||||||||
|
||||||||||
circuitsTime Limit: 30000/15000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1376 Accepted Submission(s): 487 Problem Description Given a map of N * M (2 <= N, M <= 12) , '.' means empty, '*' means walls. You need to build K circuits and no circuits could be nested in another. A circuit is a route connecting adjacent cells in a cell sequence, and also connect the first cell and the last cell. Each cell should be exactly in one circuit. How many ways do we have? Input The first line of input has an integer T, number of cases. For each case: The first line has three integers N M K, as described above. Then the following N lines each has M characters, `.¨ or `*¨. Output For each case output one lines. Each line is the answer % 1000000007 to the case. Sample Input
Sample Output
Source | ||||||||||
|