You are a Software Development Engineer at Banana Corp. Among many software in Banana Corp, you work for Banana Video. Banana video is a website where Banana customers can stream series, movies and sports.
You log the number of Banana customers (traffic) that reaches your website each minute. You have configured your website to support a fixed number of customers at a time. Now you want to monitor the traffic in the website and get alarmed if the traffic exceeds the expected threshold for a continuous period.
You have written a function $$$bananaMonitor(X_i, X_{max}, A, C)$$$ that is called at the end of each minute which takes four parameters:
Once the monitor is in alarm, it will continue to be in alarm untill it is cleared. If the monitor is in normal state it continues to be so until alarm is set. It is assured that the monitor will be at normal state in the beginning of each test case.
Now you are given $$$X_i$$$ for $$$N$$$ consecutive minutes. Could you tell the total count of minutes for which the monitor was in alarmed state?
First line of each input will contain an integer $$$T$$$ which is the number of input in each test cases.
There will be $$$4$$$ integers in the first line of each test case $$$N$$$, $$$X_{max}$$$, $$$A$$$, $$$C$$$. Next line will contain $$$N$$$ integers $$$X_1$$$ $$$X_2$$$ $$$X_3$$$ ... $$$X_N$$$, the traffic in each minute.
$$$1 \leq T \leq 100$$$
$$$1 \leq N, A, C \leq 100000$$$
$$$0 \leq X_{max}, X_i \leq 100000$$$
Output an integer $$$M$$$ for each test case, Where $$$M$$$ will be total count of minutes for which the monitor was in alarmed state.
2 9 5 3 2 2 6 8 9 6 5 4 3 6 4 1 1 1 1 2 0 2
3 2
| Название |
|---|


