#P7631. [2018年杭电多校]Rikka with Seam

[2018年杭电多校]Rikka with Seam

Rikka with Seam

Problem Description

Input

The first line contains a single integer t(1t103)t(1 \leq t \leq 10^3), the numebr of testcases. For each testcase, the first line contains three numbers $n,m,K(2 \leq n,m \leq 2 \times 10^3, 1\leq K \leq m)$. Then nn lines follow, each line contains a 01 string of length mm which describes one row of the matrix. The input guarantees that there are at most 55 testcases with max(n,m)>300\max (n,m) > 300.

Output

For each testcase, output a single line with a single number, the answer modulo 998244353998244353.

Sample Input

3

2 2 1

00

10

5 5 1

00100

10101

00100

01000

11101

5 5 2

00100

10101

00100

01000

11101

Sample Output

2

70

199

Source

2018 Multi-University Training Contest 9