Given an N * M matrix, your task is to find the number of occurences of an X * Y pattern.
The first line contains a single integer t(t ≤ 15), the number of test cases.
For each case, the first line contains two integers N and M (N, M ≤ 1000). The next N lines contain M characters each.
The next line contains two integers X and Y (X, Y ≤ 100). The next X lines contain Y characters each. Every character in the matrix is a lower case English letter.
For each case, output a single integer in its own line, the number of occurrences.
2 1 1 x 1 1 y 3 3 abc bcd cde 2 2 bc cd
0 2
Migrated from old NTUJ.
UVa 11019
No. | Testdata Range | Score |
---|