410. Windows With Average ≥ Threshold
MediumSliding Window
Count the subarrays of length k whose average is at least t.
Input format
Line 1: n k t Line 2: n integers
Output format
The count.
Example 1
Input
8 3 4 2 2 2 2 5 5 5 8
Output
3
Example 2
Input
5 1 3 1 3 5 2 4
Output
3
Constraints
1 ≤ k ≤ n ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.
Loading the MyLoginn IDE…