| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 256 MB | 98 | 18 | 14 | 18.182% |
Consider an array $A$ of length $N$ and an array $B$ of length $M$. An entanglement of these two arrays is a matrix $C$ of size $N \times M$ such that for all 0ドル \le i \le N - 1$ and 0ドル \le j \le M - 1,ドル at least one of the following conditions holds: $C[i][j] = A[i]$ or $C[i][j] = B[j]$.
You are given a matrix $C$ of size $N \times M$ and a number $K$. Your task is to count the number of pairs of arrays $(A, B)$ such that:
Print the number of such pairs modulo 10ドル^9 + 7$.
The first line of input contains three integers $N,ドル $M$ and $K$ (1ドル \le N, M \le 300,ドル 1ドル \le K \le N \times M$).
Each of the following $N$ lines contains $M$ integers separated by spaces, the $j$-th number on the $i$-th of these lines is $C[i - 1][j - 1]$.
Print a single line containing a single integer: the number of pairs of arrays $(A, B)$ modulo 10ドル^9 + 7$.
2 2 2 1 1 1 2
5