#P16755. [GKS 2020 #C] Countdown
[GKS 2020 #C] Countdown
Problem Description
Avery has an array of positive integers. The i-th integer of the array is .
A contiguous subarray is an -countdown if it is of length and contains the integers , in that order. For example, is a -countdown.
Can you help Avery count the number of -countdowns in her array?
Input Format
The first line of the input gives the number of test cases, . test cases follow. Each test case begins with a line containing the integers and . The second line contains integers. The i-th integer is .
Output Format
For each test case, output one line containing Case #x: y, where is the test case number (starting from ) and is the number of -countdowns in her array.
3
12 3
1 2 3 7 9 3 2 1 8 3 2 1
4 2
101 100 99 98
9 6
100 7 6 5 4 3 2 1 100
Case #1: 2
Case #2: 0
Case #3: 1
Hint
In sample case #1, there are two 3-countdowns as highlighted below.
- 1 2 3 7 9 3 2 1 8 3 2 1
- 1 2 3 7 9 3 2 1 8 3 2 1
In sample case #2, there are no 2-countdowns.
In sample case #3, there is one 6-countdown as highlighted below.
- 100 7 6 5 4 3 2 1 100
Limits
.
.
, for all .
Test Set 1
.
Test Set 2
for at most test cases.
For the remaining cases, .