Problem: Maxim has an array of integers and an array of integers ().
Maxim considers an array of length to be good if the elements of array can be rearranged in such a way that at least of them match the elements of array .
For example, if and , then the arrays and are good (they can be reordered as follows: and ), while the arrays and are not good.
Maxim wants to choose every subsegment of array of length as the elements of array . Help Maxim count how many selected arrays will be good.
In other words, find the number of positions such that the elements form a good array.
Input Format: The first line contains an integer () — the number of test cases.
The first line of each test case contains three integers , , and () — the number of elements in arrays and , the required number of matching elements.
The second line of each test case contains integers () — the elements of array . Elements of the array are not necessarily unique.
The third line of each test case contains integers () — the elements of array . Elements of the array are not necessarily unique.
It is guaranteed that the sum of over all test cases does not exceed . Similarly, it is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case, output the number of good subsegments of array on a separate line.
Note: In the first example, all subsegments are good.
In the second example, good subsegments start at positions , , and .
In the third example, good subsegments start at positions and .