All submissions for this problem are available.### Read problem statements in [Hindi](http://www.codechef.com/download/translated/OCT19/hindi/S10E.pdf), [Bengali](http://www.codechef.com/download/translated/OCT19/bengali/S10E.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/OCT19/mandarin/S10E.pdf), [Russian](http://www.codechef.com/download/translated/OCT19/russian/S10E.pdf), and [Vietnamese](http://www.codechef.com/download/translated/OCT19/vietnamese/S10E.pdf) as well. Chef wants to buy a new phone, but he is not willing to spend a lot of money. Instead, he checks the price of his chosen model everyday and waits for the price to drop to an acceptable value. So far, he has observed the price for $N$ days (numbere $1$ through $N$); for each valid $i$, the price on the $i$-th day was $P_i$ dollars. On each day, Chef considers the price of the phone to be *good* if it is strictly smaller than all the prices he has observed during the previous five days. If there is no record of the price on some of the previous five days (because Chef has not started checking the price on that day yet), then Chef simply ignores that previous day ― we could say that he considers the price on that day to be infinite. Now, Chef is wondering ― on how many days has he considered the price to be good? Find the number of these days. ### Input - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. - The first line of each test case contains a single integer $N$. - The second line contains $N$ space-separated integers $P_1, P_2, \dots, P_N$. ### Output For each test case, print a single line containing one integer ― the number of days with a good price. ### Constraints - $1 \le T \le 100$ - $7 \le N \le 100$ - $350 \le P_i \le 750$ for each valid $i$ ### Subtasks **Subtask #1 (30 points):** $N = 7$ **Subtask #2 (70 points):** original constraints ### Example Input ``` 1 7 375 750 723 662 647 656 619 ``` ### Example Output ``` 2 ``` ### Explanation **Example case 1:** Chef considers the price to be good on day $1$, because he has not observed any prices on the previous days. The prices on days $2, 3, 4, 5, 6$ are not considered good because they are greater than the price on day $1$. Finally, the price on day $7$ is considered good because it is smaller than all of the prices on days $2, 3, 4, 5, 6$.
|Tags||alexey_adm, cakewalk, oct19, r_64|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.