시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB45373581.395%

문제

Silence is useless. We need the world to be full of music. In computer music, volume is represented as an array of integers of length n. Silence in music is defined by 2 parameters c and m. Silence occurs in any sub-array of length m where the difference between the minimum element and the maximal element is no greater than c. For example if the volume array is [1,3,2,7,5,4,6,6] and m = 3, c = 2. Then silence occurs in the subarrays of size 3 indexed at 0, 4, and 5. Output the total number of silence intervals.

입력

The first line in the data file is an integer that represents the number of data sets to follow. Each data set is 2 lines. The first line contains n, m, c (n <= 20, m<=20, c<=1000). The second line contains n integers representing the volume array. Each integer is less than or equal to 1000.

출력

Print the total number of silence intervals for each data set.

예제 입력 1

3
8 3 2
1 3 2 7 5 4 6 6
4 2 1
1 2 3 4
4 5 900
1 1 1 1

예제 출력 1

3
3
0