시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 | 256 MB | 88 | 17 | 13 | 18.571% |
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