Matrix Matcher

Given an N × M matrix, your task is to find the number of occurences of an X × Y pattern. Input 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. Output For each case, output a single integer in its own line, the number of occurrences. Sample Input 2 11 x 11 y 33 abc bcd cde 22 bc cd Sample Output 0 2